Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Modifications to chart WPF elements and tab considerations
Collapse
X
-
It was happening because I had 6 rows and 6 grids instead of 6 rows in 1 grid. I changed to one grid, issue got fixed
-
Hi Chelsea
Me again. Still can't wrap my head around creating more buttons/grids.
I followed your model and added a second lower grid (lower1buttonsgrid ) with a further 2 buttons
then I added a new rowCode:lower1ButtonsGrid.ColumnDefinitions.Add(new System.Windows.Controls.ColumnDefinition()); lower1ButtonsGrid.ColumnDefinitions.Add(new System.Windows.Controls.ColumnDefinition() { Width = new GridLength((double)Application.Current.FindResourc e("MarginBase")) }); lower1ButtonsGrid.ColumnDefinitions.Add(new System.Windows.Controls.ColumnDefinition());
then I put my buttons into the columnsCode:addedRow3 = new System.Windows.Controls.RowDefinition() { Height = new GridLength(31) };
Then I added it to the InsertWPF methodCode:System.Windows.Controls.Grid.SetColumn(buttonsArra y[4], 0); System.Windows.Controls.Grid.SetColumn(buttonsArra y[5], 2); for (int i = 4; i < 6; ++i) lower1ButtonsGrid.Children.Add(buttonsArray[i]);
but I get no buttons at all.Code:if (chartTraderButtonsGrid != null || lower1ButtonsGrid != null) { chartTraderGrid.Children.Remove(lower1ButtonsGrid) ; chartTraderGrid.RowDefinitions.Remove(addedRow3); }
Its so frustrating. User fawzanalim managed to kindly share his code with 12 buttons but that has issues when you reload ( it moves all the instrument and account details downwards underneath the new buttons upon reload).
If you can help I would be most grateful.
Attached FilesLast edited by Mindset; 10-13-2021, 08:11 PM.
Comment
-
It contains 12 buttons. Haven't faced any issues so far. But my buttons are in the uppergrid, not lowergrid.Attached FilesLast edited by fawzanalim; 10-13-2021, 11:46 PM.
Comment
-
- Likes 1
Comment
-
Hello Mindset,
Take one step at a time.
First, are any errors appearing on the Log tab of the Control Center?
Are the indexes used all correct and smaller than the size of the collection?
Are the buttons being added to the proper columns in your custom grid?Chelsea B.NinjaTrader Customer Service
Comment
-
Hi Chelsea B
Simple dumb error that #fawzanalim helped me solve. I had the wrong margins when setting the buttons - so buttons were written over each other or not at all etc! that only took a month to sort out.
On with the next issue!
Edit - code for 8 buttons provided here as raw material for anyone else having similar issues/ looking to learn
Please note I have found in using it every now and again it won't load/fouls up - throw the chart away and use another one; works for me!
Ps Chelsea, I get nothing in the logs when this happens.Attached FilesLast edited by Mindset; 10-16-2021, 01:11 AM.
- Likes 1
Comment
-
Hi Chelsea, Thank you for the amazing sample code. I took ChartCustomToolbarExample and modified to have only the top toolbar. I simply removed all the references to left*
to get rid off the left toolbar. It didn't work. I still get blank left toolbar. Any clues? TY!
Comment
-
Originally posted by NinjaTrader_ChelseaB View PostHello cay7man,
Is the menu still being created and added to the chart grid?
For the top toolbar, Yes. Looks fine. Left bar is blank and couldn't be removed. I'm attaching the modified code...Attached Files
Comment
-
Hi Chelsea,
Thanks for the sample code. I've been using it for awhile now. Everything seems to work properly, but I get this weird bug sometimes. All my buttons disappear except the last row. I tried to regenerate the bug a lot, but couldn't. It happens with any buttons. It's working fine, all of a sudden all the buttons are gone when I pressed a button. There is no log messages. In order to bring those buttons back, I have to remove the script and add it again. Any idea whats causing this issue?
Comment
-
Originally posted by Subhash Badri View PostStill not working
I followed the exact steps like you suggested. I checked the custom\indicators folder and the file is present and I hope that confirms that import was successful.
I launch the chart but do not see any button controls.
I have the same issue man! did everything as yousaid and no changes.. what else can you suggest?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
576 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment