This is a migrated thread and some comments may be shown as answers.

Control column selection

2 Answers 76 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 26 Mar 2013, 05:06 PM
I want to use the RadGridView as a simple file explorer style display. To that end I have two columns, the first containing an icon and the second containing the filename.

While I don't mind the entire row highlighting on selection, I wish to configure the RagGridView so that it is always the second column that receives focus on selection change, this way when the user presses F2 the filename cell will enter edit mode. However I haven't found a way to do this yet. Setting the CurrentColumn on SectionChanged is having no effect.

Any suggestions please?

2 Answers, 1 is accepted

Sort by
0
Bob
Top achievements
Rank 1
answered on 26 Mar 2013, 05:34 PM
Got something that works.

private void OnRadGridView_CurrentCellChanged(object sender, GridViewCurrentCellChangedEventArgs e)
{
    GridViewCellInfo currentCell = _radGridView.CurrentCellInfo;
 
    if (currentCell != null
        && currentCell.Column != null &&
        currentCell.Column.UniqueName != "Name")
    {
        GridViewCellInfo newCell = new GridViewCellInfo(currentCell.Item, _radGridView.Columns["Name"]);
        _radGridView.CurrentCellInfo = newCell;
    }
}


0
Maya
Telerik team
answered on 27 Mar 2013, 07:04 AM
Hello Bob,

The solution you found seems quite correct. I am glad to see that you have resolved the issue.
Let us know in you need further assistance. 

All the best,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Bob
Top achievements
Rank 1
Answers by
Bob
Top achievements
Rank 1
Maya
Telerik team
Share this question
or