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 sam028 with 1 posts (1 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 1,635 views
    2. thumb_up 4 thanks given
    3. group 4 followers
    1. forum 9 posts
    2. attach_file 4 attachments




 
Search this Thread

Indicator -- Popup DataGridView - has bug

  #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?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
MC PL editor upgrade
MultiCharts
Exit Strategy
NinjaTrader
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Tao te Trade: way of the WLD
24 thanks
Just another trading journal: PA, Wyckoff & Trends
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #3 (permalink)
 
gregid's Avatar
 gregid 
Wrocław, Poland
 
Experience: Intermediate
Platform: NinjaTrader, Racket
Trading: Ockham's razor
Posts: 650 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: 650 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: 650 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: 40 since May 2012
Thanks Given: 15
Thanks Received: 100


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,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629



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 Twitter Reply With Quote
Thanked by:




Last Updated on October 17, 2015


© 2024 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 - Privacy Policy - Downloads - Top
no new posts