NexusFi: Find Your Edge


Home Menu

 





Indicator -- Popup DataGridView - has bug


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one vantojo with 4 posts (1 thanks)
    2. looks_two gregid with 3 posts (2 thanks)
    3. looks_3 Marty087 with 1 posts (0 thanks)
    4. looks_4 sam028 with 1 posts (1 thanks)
    1. trending_up 2,658 views
    2. thumb_up 4 thanks given
    3. group 4 followers
    1. forum 9 posts
    2. attach_file 4 attachments




 
Search this Thread
  #1 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012

Hi Guys,

Here is a useful, very simple indicator code base that is "almost finished".

It will pop up a window and fill a DataGridView with data. That DataGridView could be customized to hold any row/column data, with scrolling, sorting, hide/show rows, et cetera.

The problem I'm trying to solve is that the grid does not have a vertical scroll bar and I can't see all the data.

Also, I would like the grid to resize to fill the entire Form initially and then whenever the Form is resized. And, of course with horizontal and vertical scroll bars if needed.

Any C# gurus out there? The code base could have many different custom applications.

Thanks


Attached Files
Elite Membership required to download: BMTGrid.cs
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Irans Answer Due Today: Peace Surges to 33.5%, Invasion …
Prediction Markets & Event Contracts
Victory Day Delivers: Russia-Ukraine Ceasefire Market Cl …
Prediction Markets & Event Contracts
Iran Airspace Contract Surges to 33.5% as Project Freedo …
Prediction Markets & Event Contracts
Prediction Markets Expiry Day: Trump Eyes War Exit, $230 …
Prediction Markets & Event Contracts
MyForexFunds Begins Returning Frozen Funds After CFTC Ca …
Funded Trading Evaluation Firms
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Lady Vols Primer: Trading Volatility Journal
7 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #3 (permalink)
 
gregid's Avatar
 gregid 
Wrocław, Poland
 
Experience: Intermediate
Platform: NinjaTrader, Racket
Trading: Ockham's razor
Posts: 649 since Aug 2009
Thanks Given: 320
Thanks Received: 623



vantojo View Post
The problem I'm trying to solve is that the grid does not have a vertical scroll bar and I can't see all the data.

Also, I would like the grid to resize to fill the entire Form initially and then whenever the Form is resized. And, of course with horizontal and vertical scroll bars if needed.

In your OnStartUp add the following:
 
Code
MyForm.AutoScroll = true;
This will give you both scrollbars (if doesn't fit in the screen)


Reply With Quote
  #4 (permalink)
 
gregid's Avatar
 gregid 
Wrocław, Poland
 
Experience: Intermediate
Platform: NinjaTrader, Racket
Trading: Ockham's razor
Posts: 649 since Aug 2009
Thanks Given: 320
Thanks Received: 623

For your information - the DataGridView has scrollbars always set to true but since it is setup to autosize it means there is no need for scrollbars since it just fills the space inside the form. That's why in this set up scrollbars on the MyForm are required. Test setting:
 
Code
MyGrid.AutoSize = false;
To see that scrolls on the grid will automatically show up.


Reply With Quote
Thanked by:
  #5 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012

OK, I made those two changes, but now get this....

I would like the grid to resize to use the entire form, and to have scroll bars....


Started this thread Reply With Quote
  #6 (permalink)
 
gregid's Avatar
 gregid 
Wrocław, Poland
 
Experience: Intermediate
Platform: NinjaTrader, Racket
Trading: Ockham's razor
Posts: 649 since Aug 2009
Thanks Given: 320
Thanks Received: 623

 
Code
MyGrid.AutoSize = false;
was only a test for you to do - don't do 2 of those changes at the same time - I explained in my second post of why it behaves the way it does - it is not a bug. You either need to have scrollbars added to MyForm OR your grid needs to have fixed size (you could try setting Height and Width or Maximum Height and Maximum Width to have a compromise)

But first try changing only MyForm (my first post) and see if it suffices.


Reply With Quote
Thanked by:
  #7 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012

Yes, using only MyForm.AutoScroll = true worked....

The scroll bars are on the form, which in this case works OK.

I was wanting the scroll bars on the Grid....but this will do for this particular use.

Thank you.


Started this thread Reply With Quote
  #8 (permalink)
 Marty087 
Sydney NSW Australia
 
Experience: Intermediate
Platform: Ninjatrader 7 / MT4
Broker: KINETICK
Trading: EUR/USD, AUS200(SPI)
Posts: 42 since May 2012
Thanks Given: 19
Thanks Received: 107


vantojo View Post
Hi Guys,

Here is a useful, very simple indicator code base that is "almost finished".

It will pop up a window and fill a DataGridView with data. That DataGridView could be customized to hold any row/column data, with scrolling, sorting, hide/show rows, et cetera.

Thanks for sharing this Vantojo!

I am missing the system.data assembly. Do i just need to find the dll on the web and then reference it?

Thanks


Reply With Quote
  #9 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012


Marty087 View Post
Thanks for sharing this Vantojo!

I am missing the system.data assembly. Do i just need to find the dll on the web and then reference it?

Thanks

System.Data is part of the dot net framework (not ninjatrader) that needs to be installed on your computer...you would not load it individually, it is part of a dot net install

Right now I'm in the middle of an international move...so this is the best I can tell you at the moment


Started this thread Reply With Quote
  #10 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,756 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,632



Marty087 View Post
Thanks for sharing this Vantojo!

I am missing the system.data assembly. Do i just need to find the dll on the web and then reference it?

Thanks

See
You have to add a reference of the assembly, and the .dll should be here:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\vX.Y\System.Data.dll


Success requires no deodorant! (Sun Tzu)
Follow me on X Reply With Quote
Thanked by:




Last Updated on October 17, 2015


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts