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

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

1 Answer 244 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Veeraguru
Top achievements
Rank 1
Veeraguru asked on 24 Jul 2013, 05:11 AM
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. 

1 Answer, 1 is accepted

Sort by
0
Accepted
Yoan
Telerik team
answered on 26 Jul 2013, 01:59 PM
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 >>
Tags
General Discussions
Asked by
Veeraguru
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or