We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Selecting entire row

Hi
I have two visible columns in child table row of GGC,they are displaying in two cells in a row now.i would like to select entire row, but at the moment i can able to select cell by cell.how can i do that???. Please help me

Thanks
Siviah

1 Reply

AD Administrator Syncfusion Team August 16, 2006 05:14 PM UTC

If you want this behavior (selecting rows) for all your tables, then you can set these properties.

this.grid.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended;
this.grid.TableOptions.ListBoxSelectionCurrentCellOptions = GridListBoxSelectionCurrentCellOptions.None;


But if you only want this behavior on a single table, then you can handle an event instead of setting the ListBoxSelectionMode (You still have to set the istBoxSelectionCurrentCellOptions to none).


void hierarchyGrid_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
{
if (e.TableControl.Table.TableDescriptor.Name == "ChildTable")//name of your child table
{
GridCurrentCell cc = e.TableControl.CurrentCell;
GridTableCellStyleInfo style = e.TableControl.GetViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex) as GridTableCellStyleInfo;
GridRecord r = style.TableCellIdentity.DisplayElement.GetRecord() as GridRecord;
if (r != null)
{
e.TableControl.Table.SelectedRecords.Clear();
r.SetSelected(true);
}
}
}

Loader.
Live Chat Icon For mobile
Up arrow icon