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

[Solved] ADDING A NEWROW AFTER THE SELECTED ROW IN THE TELRIK GRID

2 Answers 102 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Keshava
Top achievements
Rank 1
Keshava asked on 18 Jan 2011, 12:31 PM
Hi,
     I went througth the sample project which you had sent to insert the row after the selected row in the grid..
     I am using radDomainDataSource to bind to grid i need to insert new row after the selected row.
     I followed your sample while debugging i found a null reference.
  when i assign
 var source = this.radGridView1.ItemsSource as ObservableCollection<Web.SupplierAccount>;
 i get values in itemsSource but its not getting loaded into source;
I have attached my project below;
radGridView1.IsReadOnly=false;
           var selectedRow = radGridView1.SelectedItem as Web.SupplierAccount;
          // radGridView1.BeginInsert();
           var newRow = new Web.SupplierAccount()
           {
               Name = "enter"
           };
           var source = this.radGridView1.ItemsSource as ObservableCollection<Web.SupplierAccount>;
           source.Insert(this.radGridView1.Items.IndexOf(selectedRow) + 1, newRow);

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 18 Jan 2011, 12:35 PM
Hello,

 I'm not sure what sample you are referring since this is your first post ever. Can you clarify?

Best wishes,
Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Keshava
Top achievements
Rank 1
answered on 18 Jan 2011, 12:55 PM
Hi, 
       my collegue had  got a sample posted from your team...
       I had taken it from my collegue..
       the project folder name is RadGridView_SL_AR_3 
Tags
GridView
Asked by
Keshava
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Keshava
Top achievements
Rank 1
Share this question
or