I have DevExpress GridControl with one default GridView to show the records in my form. I have bound the values to GridControl from SQL Database table. Here, I want to select the single column's values as array or something similar using mouse click with any key combination. I have googled and get the solution to select multiple rows using CheckBox column.
But, my scenario is different. I would like to select single column's values as array.
EDIT: I am also looking for an answer which needs to be highlight all cell values when clicked with any key combination in column header (similar like we have an option in Microsoft Excel).
Thanks in advance.
I don' think that there is a built-in method to do that. You can loop through rows and use
ColumnView.GetRowCellValueto access the cells from a particular column.Something like this should work:
UPDATE: You can refer to the official example in DevExpress knowledge base: How to select cells under by clicking the GridBand or the column header.
What you'll need to do:
MouseDownevent on a gridview;CalcHitInfoto detect a click on a column header (check out this question: "Detect the column header region in the mouse down event of a grid)" and this knowledge base article: "Hit Information";then use
GridView.SelectCellto update selectionIf your grid view is editable, cell editors might steal the
MouseDownevent. In this case, you'll need to reconfigure the grid as described in this discussion: GridView - How to catch a cell click?