I had a custom checkbox column to the grid part of the ultraganttview control and it works fine.
I would like to add a "select all" feature, using a checkbox in the column header of my custom column, like in a normal ultragrid :
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.2/CLR2.0/html/WinGrid_Displaying_Checkbox_in_Column_Header.html
Is it possible to do the same thing with the ultraganttview control and how?
Thanks,
Hello Vincent,
You can use the normal grid way of enabling the checkbox in the header of the column. The caveat is that the UltraGanttView does not expose the grid it encapsulates, so you'll need to use some reflection to get it. You can use code similar to the following to do so.
var grid = ganttViewType.InvokeMember("grid", BindingFlags.GetField | BindingFlags.Instance | BindingFlags.NonPublic, null, ultraGanttView1, null) as UltraGrid;var column = grid.DisplayLayout.Bands[0].Columns["checkBox"];
Hi,
I had the same idea after reading this post http://es.infragistics.com/community/forums/t/59490.aspx where reflection is used to exclude columns from the column choser.
So I tried this solution, but the behavior is strange :
- when all the rows are checked the checkbox in the header is checked => that's correct
- when all the rows are unchecked the checkbox in the header is unchecked => that's correct too
But if I click on the checkbox in the header, its checkstate doesn't change.
It seems that the header is a readonly checkbox whereas the checkbox in rows are not readonly.
Thank you for this information.
I've created a support case for this issue and submitted it to our engineers for them to look at. I will make another post on this thread once I've heard back from them.
This issue has been resolved in the latest Service Release as of the date of this post.
Wow never knew you could do that been wanting to get at the various grid functions for ages, this should be highlighted in the documenation as I only came accross this by chance!
P.s. If anyone wants the VB translation see below...
Dim GanttGrid As Infragistics.Win.UltraWinGrid.UltraGrid
GanttGrid = GetType(Infragistics.Win.UltraWinGanttView.UltraGanttView).InvokeMember("grid", BindingFlags.GetField Or BindingFlags.Instance Or BindingFlags.NonPublic, Nothing, ugvOffering, Nothing)