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

CommitEdit problem

1 Answer 180 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Julien
Top achievements
Rank 1
Julien asked on 19 Jun 2013, 10:08 AM
HI, 
I use in my application a gridview with four buttons to delete and add a row and to save or cancel the edit. The delete and add buttons work perfectly but not the save insert/edit button. I don't understand where is the problem in my code, if someone could help.
This is my xaml : 
<Grid Name="indicatorPage" Visibility="Hidden" Margin="0,194,0,-194">
               <Grid.RowDefinitions>
                   <RowDefinition Height="Auto" />
                   <RowDefinition />
               </Grid.RowDefinitions>
           <StackPanel Orientation="Horizontal"
                   HorizontalAlignment="Center"
                   Margin="0,5,0,0">
               <telerik:RadButton Width="150"
                              Content="Delete selected rows"
                              Margin="0,0,5,0"
                              Command="telerikGrid:RadGridViewCommands.Delete"
                              CommandTarget="{Binding ElementName=gvIndicatorConf}" />
               <telerik:RadButton Width="150"
                              Content="Add new row"
                              Margin="0,0,5,0"
                              Command="telerikGrid:RadGridViewCommands.BeginInsert"
                              CommandTarget="{Binding ElementName=gvIndicatorConf}" />
               <telerik:RadButton Width="150"
                              Content="Save insert/edit"
                              Margin="0,0,5,0"
                              Command="telerikGrid:RadGridViewCommands.CommitEdit"
                              CommandTarget="{Binding ElementName=gvIndicatorConf}" />
               <telerik:RadButton Width="150"
                              Content="Cancel insert/edit"
                              Command="telerikGrid:RadGridViewCommands.CancelRowEdit"
                              CommandTarget="{Binding ElementName=gvIndicatorConf}" />
           </StackPanel>
           <telerik:RadGridView x:Name="gvIndicatorConf" 
                                ItemsSource="{Binding IndicatorConf}"
                                AddingNewDataItem="radGridView_AddingNewDataItem"
                                Margin="0,5,0,0" Grid.Row="1" 
                                AutoGenerateColumns="False" telerik:StyleManager.Theme="Windows8"
                                MaxHeight="7000" MaxWidth="1000">
               <telerik:RadGridView.Columns>
                   <telerik:GridViewColumn Width="90">
                       <telerik:GridViewColumn.CellTemplate>
                           <DataTemplate>
                               <telerik:RadButton Content="Delete"
                                              Command="telerikGrid:RadGridViewCommands.Delete"
                                              CommandParameter="{Binding}" />
                           </DataTemplate>
                       </telerik:GridViewColumn.CellTemplate>
                   </telerik:GridViewColumn>
                   <telerik:GridViewDataColumn DataMemberBinding="{Binding Code}" Header="Code" UniqueName="Code" />
                   <telerik:GridViewDataColumn DataMemberBinding="{Binding Descritpion}" Header="Descritpion" UniqueName="Descritpion" />
                   <telerik:GridViewDataColumn DataMemberBinding="{Binding Connecter}" Header="Connecter" UniqueName="Connecter" IsReadOnly="True"/>
                   <telerik:GridViewDataColumn DataMemberBinding="{Binding Period}" Header="Period" UniqueName="Period" />
               </telerik:RadGridView.Columns>
           </telerik:RadGridView>
       </Grid>

Thanks !

1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 21 Jun 2013, 01:37 PM
Hi Julien,

I've tried to reproduce the problem you report, but to no avail. I have attached my test project for a reference. Would it be possible to modify it in order to reproduce the problem and resend it back to me ?

Looking forward to hearing from you!


Regards,
Yoan
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Julien
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or