Change GridView to EditMode when creating new row

2 posts, 1 answers
  1. Jeff
    Jeff avatar
    2 posts
    Member since:
    Feb 2016

    Posted 25 Mar 2016 Link to this post

    I have a gridview with 10 columns, only one is editable when not a new row. When I create a NewRow, I want that row to be editable. We've tried many different ways, but we can't get it to work. Any help would be welcome.




  2. Answer
    Dimitar avatar
    1929 posts

    Posted 28 Mar 2016 Link to this post

    Hi Jeff,

    Thank you for writing.

    You can use the CellBeginEdit method to cancel the edit operation for particular cells/columns. The following snippet shows how you can disable the data rows editing (the new row would be editable) for two columns: 
    private void RadGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        if (e.Row is GridViewDataRowInfo)
            if (e.Column.Name == "Name" || e.Column.Name == "Date")
                e.Cancel = true;

    Let me know if you have additional questions.

    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top