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

cannot add new row with ria

1 Answer 78 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.
Michal Revivo
Top achievements
Rank 1
Michal Revivo asked on 18 Dec 2010, 10:34 PM
Hi
I need urgently your help.
I am stuck to add new record.
I obtain a crash after submitChanges. I try all your samples and threads. I take sample from CRUID sample.
WHAT IS MISSING ??????????????

private void radGridView_AddingNewDataItem(object sender, GridViewAddingNewEventArgs e)
{ var form = new Form()
 {  DateForm = app.lastDateForm,
     UserId = app.userId
 };
 e.NewObject = form;
 DomainService2 context = this.formDomainDataSource.DomainContext as DomainService2;
 context.Forms.Add(form);
}
private void radGridView_RowEditEnded(object sender, Telerik.Windows.Controls.GridViewRowEditEndedEventArgs e)
{
 formDomainDataSource.SubmitChanges();
}
XAML is
<Grid.Resources>
 <ria:DomainDataSource AutoLoad="False"
  x:Name="formDomainDataSource"
  QueryName="GetFormsByDateQuery" >
  <ria:DomainDataSource.DomainContext>
   <my:DomainService2 />
  </ria:DomainDataSource.DomainContext>
 </ria:DomainDataSource>
</Grid.Resources>

<telerik:RadGridView
 Visibility="Visible" x:Name="radGridView"
 ShowInsertRow="True" ShowGroupPanel="False"
 AutoGenerateColumns="True"
 AddingNewDataItem="radGridView_AddingNewDataItem"
 RowEditEnded="radGridView_RowEditEnded"
 DataContext="{StaticResource formDomainDataSource}"
 ItemsSource="{Binding Data}" IsBusy="{Binding IsBusy}">
</telerik:RadGridView>

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 20 Dec 2010, 07:58 AM
Hi Michal Revivo,

You may take a look at this forum thread for a reference.  

All the best,
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
GridView
Asked by
Michal Revivo
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or