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

Issue with radgridview row edit and adding a new row

0 Answers 145 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sandeep
Top achievements
Rank 1
Sandeep asked on 09 Sep 2013, 02:56 PM

Hello All,
I am facing an issue with radGridView row edit, inserting a new row and updating the database.  On the UI when I try to edit a row or add a new row, the grid looks behaves like a disabled though I did not set any properties for it and I am unable to the grid.   Can someone help me on this?

Xaml :
  
 <telerik:RadGridView  AutoGenerateColumns="False"  Width="200" Height="125" Name="Grid"
               CanUserInsertRows="True"   

                 GroupRenderMode

 

 

="Flat"

 

      
ShowGroupPanel="False" RowIndicatorVisibility="Collapsed"  ItemsSource="{Binding ListBindingToGrid,Mode= TwoWay}" >
                <telerik:RadGridView.Columns>
                           <telerik:GridViewDataColumn Header="Id" DataMemberBinding="{Binding Path=Id, Mode =TwoWay}" Width="*"  />
                          <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Path=Name , Mode=TwoWay}" Width="*"  />
                  </telerik:RadGridView.Columns>
 </telerik:RadGridView>
  
<telerik:RadButton Name="button_Save"  Content="Save" Command="{Binding SaveDataCommand}" Width="75" Height="23"   CommandParameter="{Binding ElementName=Grid, Path=SelectedItem.Id}">
  
Codebehind
   
 private List<dynamic>  m_listbindingtogrid;
 public List<dynamic> ListBindingToGrid
        {
            get
            {
                return m_listbindingtogrid;
            }
            set
            {
                 m_listbindingtogrid= value;
                RaisePropertyChanged("ListBindingToGrid");
            }
        }
  
private void LoadGrid()
{
      ListBindingToGrid = (from customers in Database.Customers select new 
                                        {  Id= customers.Id,  Name = customers.Name} ).ToList<dynamic>();
}
  
private void SaveData(int Id)
{
 // some code to update the database 
}

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Sandeep
Top achievements
Rank 1
Share this question
or