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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Selecting entire row

Thread ID:

Created:

Updated:

Platform:

Replies:

47952 Aug 16,2006 04:25 PM UTC Aug 16,2006 05:14 PM UTC Windows Forms 1
loading
Tags: GridControl
Sivaiah Boppana
Asked On August 16, 2006 04:25 PM UTC

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

Administrator [Syncfusion]
Replied On 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);
}
}
}

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;