I'd like to select all rows by clicking the header of row selector like excel, but I can't find the property to show the header of the row selector.
The first column Header is expanded to the header of the row selector.
Is there any properties to show the header of row selector?
or Is there any idea to select all rows by clicking once??
Hello JungHyuk,
Thank you for posting in our forum.
Please find below the answers to your questions:
Is there any properties to show the header of row selector – in order show row selector header you need to set the RowSelectorHeaderStyle property. You can use code like this:
this.ultraGrid1.DisplayLayout.Override.RowSelectorHeaderStyle = RowSelectorHeaderStyle.SeparateElement;
More about RowSelectorHeaderStyle property you may find by follow the next link http://help.infragistics.com/Help/Doc/WinForms/2014.2/CLR4.0/html/Infragistics4.Win.UltraWinGrid.v14.2~Infragistics.Win.UltraWinGrid.UltraGridOverride~RowSelectorHeaderStyle.html
Is there any idea to select all rows by clicking once – with RowSelectorHeaderStyle set to SeparateElement you can check in MouseClick event handler if the RowSelectorHesder was clicked. If so add all the rows of the grid to Selected.Rows collection. You can use code like this:
private void UltraGrid1_MouseClick(object sender, MouseEventArgs e)
{
UltraGrid grid = sender as UltraGrid;
if (grid != null)
RowSelectorHeaderUIElement rowSelectorHeaderUIElement = grid.DisplayLayout.UIElement.ElementFromPoint(e.Location) as RowSelectorHeaderUIElement;
if (rowSelectorHeaderUIElement != null)
this.ultraGrid1.Selected.Rows.AddRange((UltraGridRow[])this.ultraGrid1.Rows.All);
}
Please check the attached sample solution implementing this approach and let me know if this is what you are looking for or if I am missing something.
Thank you for using Infragistics Controls.
Sincerely,
Milko
Developer Support Engineer
Infragistics
www.infragistics.com/support