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

BeginInsert does not insert a new row

1 Answer 59 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tao Jiang
Top achievements
Rank 1
Tao Jiang asked on 19 Nov 2009, 04:27 PM

The grid is 2009 Q2.
Grid.ItemSource = dataTable.

 

private

 

void btnAdd_Click(object sender, RoutedEventArgs e)

 

{

     Grid.BeginInsert();
}

Is it because the dataTable has a few primary keys?

How do I resolve this?

Thanks

1 Answer, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 25 Nov 2009, 09:41 AM
Hello Tao Jiang,

Generally DataTable is not an observable collection, so you have two options:

  1. Handle RadGridView.AddingNewDataItem event and supply new business object to the args.NewObject.
  2. use Grid.ItemsSource = dataTable.DefaultView;

Let me know if this does not help.
Kind regards,
Nedyalko Nikolov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Tao Jiang
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Share this question
or