Profile Picture

BestFit / ChooseColumns in NDataGridView control

Posted By Tomas Vera 13 Years Ago
Author
Message
Tomas Vera
Posted 13 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 4, Visits: 1
Hello,
I am using a NDataGridView control to display some data.

If I right-click a column header, a context-menu appears that allows me to ChooseColumns, apply BestFit and Order columns.

However, it seems I am not able to do this programatically.

Is there an event that I can fire which will allow the NDataGridView to perform the BestFit or the ChooseColumns functionality.

How can I trigger these events? Or is there another way to accomplish this?


Nevron Support
Posted 13 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)

Group: Forum Members
Last Active: 15 hours ago
Posts: 3,043, Visits: 3,777
Hello Tomas,

To perform best fit for specific column you should call
nDataGridView1.AutoResizeColumn(int columnIndex);

To perform best fit for all columns you should call
nDataGridView1.AutoResizeColumns();

Choose Columns dialog is implemented as an internal class and it cannot be displayed from other place than context menu.
However, this dialog is basically a form with nListView control which displays all columns of a NDataGridView as list items.
Each item's Tag property is set to the respective column, and when you check or uncheck an item the respective column becomes visible or not.

Hope this helps.




Best Regards,
Nevron Support Team



Tomas Vera
Posted 13 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 4, Visits: 1
Thanks!! This was exactly what I implemented. A NListBox with the column in the Tag property.




Similar Topics


Reading This Topic