Hello,
I have this problem regarding the selecting process of grids.
If I have the AllowSelection property set to (Row,Multiple,AlphaBlend) and ListBoxSelectionMode set to MultiExtended.
My problem is that clicking on a selected row will NOT unselect my selected rows. Which is annoying. especially when I select all the rows. There can't be an easy way to deselect the rows. Furtheremore, i tried to manually deselect rows on the cellclick event but apparantly when a row is selected its cells won't fire that event.
So, in short how can i configure a grid to deselect all selected rows when user click on any row?
I'm using vs2005 sp1, and syncfusion v 4.2
Thanks
AD
Administrator
Syncfusion Team
March 23, 2007 05:16 PM UTC
Hi Mephistodan,
The GridGroupingControl has two types of selection mode.
Type 1: Row based selection
This selection support can be turned on by setting the grid.tableOptions.AllowSelections to something other than None. This selection functionality raises events like the grid.TableModel.SelectionChanging/Changed.
[c#]
this.gridGroupingControl1.TableControl.Selections.Add(GridRangeInfo.Row(3));
Type 2: Record based selection
This selection support is turned on by setting the grid.TableOptions.AllowSelections to None and setting the grid.TableOptions.ListBoxSelectionMode to something other than None.
[c#]
this.gridGroupingControl1.Table.SelectedRecords.Add(record);
Please refer to the following KB article for more details.
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=344
Best regards,
Haneef
AD
Administrator
Syncfusion Team
March 23, 2007 06:24 PM UTC
Hello,
Thanks for your reply.
Sorry if I'm missing something obvious here, but i see your reply irrelevant to my question.
I simply want the grid to deselect current rows when the user click on any of the already-selected records.
How can I achieve this?
I tried both selection types you suggested and even a mix of them but both failed.
Thanks
AD
Administrator
Syncfusion Team
March 23, 2007 09:55 PM UTC
Hi,
CellBased Selection Techinque:
>>>>> Use the TableModel.Selections.Remove method to remove selected ranges in a grid.
[c#]//TableControlCellClick event.
grid.TableModel.Selections.Remove( GridRangeInfo.Row(e.Inner.RowIndex));
RecordBased Selection Techinque:
>>>>>Use the Table.SelectRecords.Remove method to remove the records from the SelectedRecords collection.
[c#] //TableControlCellClick event.
grid.Table.SelectRecords.Remove( this.grid.Table.CurrentRecord);
Best regards,
Haneef