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

Force to highlight row on selection, and related some program problem

Dear Sir :

Today, I have read your example 
https://www.syncfusion.com/kb/644/how-to-select-the-whole-row-wherever-you-click

to force the grid control to select whole row on user click any cell

However, we have get some problem after that:
1. When I complete our statement and dispose the form, it will get exception error and the source come from "Syncfusion.Grid.Grouping.Windows" <- I can skip this error under the exception case
2. The Text in custom filter bar will not be work.

Therefore, is that any good way to force user to select the whole row (without using event method?)

Thanks

Michael 

3 Replies

VS Venkatesh Sundaram Syncfusion Team August 17, 2015 01:17 PM UTC

Hi Michael,

Thank you for your interest in Syncfusion products.

To select the whole row without using the events, you can use the property ListBoxSelectionMode.

Code snippet:


//Disables the grid selection
gridGroupingControl1.TableOptions.AllowSelection = Syncfusion.Windows.Forms.Grid.GridSelectionFlags.None;


//Used to select the whole row

gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.One;

Let me know if you have any queries.

Regards,

Venkat.



MK Michael K August 18, 2015 08:31 AM UTC

Dear Venkat:

Thank for your advise, it work, 
but for solving selection cell background color is different from other column , 
I have add one more code
 gridGroupingControl1.TableOptions.ListBoxSelectionCurrentCellOptions = GridListBoxSelectionCurrentCellOptions.None

Thanks

Michael


VS Venkatesh Sundaram Syncfusion Team August 18, 2015 11:01 AM UTC

Hi Michael,

Thanks for the update.

If you set the ListBoxSelectionCurrentCellOptions as None, the current cell drawn with the same color used for highlighting the whole record. Please refer the below kb for reference.

http://help.syncfusion.com/ug/windows%20forms/index.html#!Documents/recordbasedselection.htm

http://help.syncfusion.com/ug/windows%20forms/index.html#!Documents/focusedselection.htm


Please let us know if you have any concern.

Regards,
Venkat


Loader.
Live Chat Icon For mobile
Up arrow icon