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

Unable to insert a new row

1 Answer 24 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dan Harvey
Top achievements
Rank 2
Dan Harvey asked on 29 Mar 2011, 08:08 PM
Hello,

I have a GridView that is bound to my seriesViewModel (which come from a web serivice call).  And I have a button to insert a row in the grid, however, it doesn't work:

What am I missing?

<telerik:RadGridView Name="dgSeries" 
                                      Grid.Row="1" 
                                       AutoGenerateColumns="False" 
                                       ShowGroupPanel="False"
                                       ItemsSource="{Binding AllSeries}">
                       <telerik:RadGridView.Columns>
                           <telerik:GridViewDataColumn>
                               <telerik:GridViewDataColumn.CellTemplate>
                                   <DataTemplate>
                                       <Button x:Name="btnSave" Height="20" Width="100" Command="{Binding SaveCommand}">
                                           <TextBlock><Run Text="Update" /></TextBlock>
                                       </Button>
                                   </DataTemplate>
                               </telerik:GridViewDataColumn.CellTemplate>
                           </telerik:GridViewDataColumn>
                           <telerik:GridViewDataColumn>
                               <telerik:GridViewDataColumn.CellTemplate>
                                   <DataTemplate>
                                       <Button x:Name="btnDelete" Height="20" Width="100" Command="{Binding DeleteCommand}">
                                           <TextBlock><Run Text="Delete" /></TextBlock>
                                       </Button>
                                   </DataTemplate>
                               </telerik:GridViewDataColumn.CellTemplate>
                           </telerik:GridViewDataColumn>
                           <telerik:GridViewDataColumn Header="ID" DataMemberBinding="{Binding ID}" IsReadOnly="True" />
                           <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}" IsReadOnly="False" />
                           <telerik:GridViewDataColumn Header="NavPerShare" DataMemberBinding="{Binding NavPerShare}" IsReadOnly="False" />
                       </telerik:RadGridView.Columns>
                   </telerik:RadGridView>
                   <telerik:RadButton Width="80" 
                              Content="New" 
                              Margin="0,0,5,0"
                              HorizontalAlignment="Left"
                              Command="telerik:RadGridViewCommands.BeginInsert" 
                              CommandTarget="{Binding ElementName=dgSeries}"  />

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 30 Mar 2011, 06:54 AM
Hi,

 Can you clarify what is the type of AllSeries? Is it ObservableCollection<T> or IList or something else?

Regards,
Vlad
the Telerik team
Tags
GridView
Asked by
Dan Harvey
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Share this question
or