Control column selection

3 posts, 0 answers
  1. Bob
    Bob avatar
    20 posts
    Member since:
    Mar 2012

    Posted 26 Mar 2013 Link to this post

    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. Bob
    Bob avatar
    20 posts
    Member since:
    Mar 2012

    Posted 26 Mar 2013 Link to this post

    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;
        }
    }


  3. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 27 Mar 2013 Link to this post

    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.

Back to Top