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

Highlight a column or a row

If you click a row header of a CridControl, the column is hightlighted. Same thing is true for a row. My question is how do you do it in code? In my program, when the user clicks other controls, I want the corresponding column including the header in the GridControl being highlighted. Thank you very much for help. J. Sun

5 Replies

AD Administrator Syncfusion Team June 28, 2005 10:41 PM UTC

You can use code like: this.grid.Selections.SelectRange(GridRangeInfo.Col(2), true); this.grid.Selections.SelectRange(GridRangeInfo.Row(4), true);


SS Sharad Sharma June 30, 2005 01:34 PM UTC

Hi Clay, I have a DataGridBoundData, on which the current row is moved up or down ward by using btnUp and btnDown buttons. My query is that, "the current row after move should again be highlighted". Awaiting for your reply. Thanks Takecare, bye Sharad Kapil Sharma >You can use code like: > >this.grid.Selections.SelectRange(GridRangeInfo.Col(2), true); >this.grid.Selections.SelectRange(GridRangeInfo.Row(4), true); >


AD Administrator Syncfusion Team June 30, 2005 01:59 PM UTC

I assume your buttons are moving the grid.CurrentCell, correct? If so, the first thing to try is setting this property to see if this gives you what you want. grid.ListBoxSelectionMode = SelectionMode.One; If it does not, if you will explain what you need different, then maybe we can suggest something else.


SS Sharad Sharma July 12, 2005 09:10 AM UTC

Hi Clay Burch, I have found the solution for my problem. Thanks >I assume your buttons are moving the grid.CurrentCell, correct? > >If so, the first thing to try is setting this property to see if this gives you what you want. > >grid.ListBoxSelectionMode = SelectionMode.One; > > >If it does not, if you will explain what you need different, then maybe we can suggest something else.


MN Martin Nitschke August 14, 2006 03:57 PM UTC

I had an identical problem and yes, the solution Clay provided did fix the problem described for moving with Up/Down buttons.

For future reference, please do not just say "I have found the solution for my problem". Please post what the solution was, so people with an identical problem may know.

Thanks

>Hi Clay Burch,
>I have found the solution for my problem.
>
>Thanks
>
>>I assume your buttons are moving the grid.CurrentCell, correct?
>>
>>If so, the first thing to try is setting this property to see if this gives you what you want.
>>
>>grid.ListBoxSelectionMode = SelectionMode.One;
>>

>>
>>If it does not, if you will explain what you need different, then maybe we can suggest something else.

Loader.
Live Chat Icon For mobile
Up arrow icon