Inserting a new row and adding values to readonly column in RadGridView

2 posts, 1 answers
  1. Veeraguru
    Veeraguru avatar
    9 posts
    Member since:
    Jul 2013

    Posted 24 Jul 2013 Link to this post

    Hi,

    I have three columns (Eg:ID ,Name, Location) ID column is readonly. When i insert new row by setting ShowInsertRow="True" and CanUserInsertRows="True" i need to enter the value for the ID column. How to achieve this? I am following MVVM pattern.

    Thanks in Advance. 
  2. Answer
    Yoan
    Admin
    Yoan avatar
    1066 posts

    Posted 26 Jul 2013 Link to this post

    Hi,

    In order to achieve your goal, you handle AddingNewDataItem and RowEditEnded events like so:

    private void clubsGrid_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
           {
               this.clubsGrid.Columns[0].IsReadOnly = false;
           }
     
           private void clubsGrid_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
           {
     
               this.clubsGrid.Columns[0].IsReadOnly = true;
           }



    Regards,
    Yoan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top