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

UI to deselect rows

Thread ID:

Created:

Updated:

Platform:

Replies:

58412 Mar 23,2007 11:40 AM UTC Mar 23,2007 09:55 PM UTC Windows Forms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On March 23, 2007 11:40 AM UTC

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

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

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

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

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

;