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

Selecting Rows & Cols

By default, when a user clicks the column header in a Grid control, the entire col is highlited and selected. In my case, I'm inside the OnKeyUp event, handling some... shall we say ... "magic key strokes". When they occur I need to be able to move the selection to the col header cell & select the entire col programmatically, just as if the user had selected the col header w/ the mouse in the first place. I have the current ColIndex, so how do I tell it to do the normal column selection and hilite? I tried calling my existing OnMouseDown event on this col header cell as shown in the attached file. But this only seems to select the one col header cell, not the entire column. So, how do I select & hilite the entire column?

2 Replies

AD Administrator Syncfusion Team September 15, 2003 03:50 PM UTC

You can select a column programatically with code like: grid.Selections.Add(GridrangeInfo.Col(colIndex)); Will this do what you need?


JB John Bowman September 17, 2003 11:31 AM UTC

Clay, That's it! Thanks... seems to work great. John

Loader.
Live Chat Icon For mobile
Up arrow icon