We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to make a DataGrid editable

Hello,

I am trying to make data grid editable but failed. I have following property class.

 public class ProcedurePerformed
    {
        public int ID { get; set; }
        public string CASEID { get; set; }
        public string PROCEDUREPERFORMED { get; set; }
        public DateTime PROCEDUREDATE { get; set; }
        public string COMPLICATION { get; set; }
        public bool IsAlreadySaved { get; set; }
    }

I just want to show three properties (PROCEDUREPERFORMED , PROCEDUREDATE , COMPLICATION ) in datagrid and want to edit them in grid.
where PROCEDUREPERFORMED should input through Dropbox, PROCEDUREDATE should input through DatePicker, and COMPLICATION through TextBox .


Thanks

3 Replies

GT Gnanasownthari Thirugnanam Syncfusion Team February 27, 2017 09:58 AM UTC

Hi Muhammad, 
 
Thank you for contact Syncfusion Support. 

We have analyzed your query, you can achieve your requirement “data grid editable” by setting SfDataGrid.AllowEditing as true for SfDataGrid or editing particular column by setting GridColumn.AllowEditing as true like below code example. 
 
C# 
<syncfusion:SfDataGrid x:Name="grid"  
                               DataContext="{StaticResource dataContext}" 
                               AllowEditing="True"                              
                               AutoExpandGroups="True" 
                               AutoGenerateColumns="False"                              
                               ItemsSource="{Binding OrderInfoCollection}"> 
            <syncfusion:SfDataGrid.Columns> 
                <syncfusion:GridTextColumn HeaderText="COMPLICATION" MappingName="COMPLICATION" AllowEditing="True"/> 
                <syncfusion:GridComboBoxColumn ItemsSource="{Binding Companies, Source={StaticResource dataContext}}" MappingName="PROCEDUREPERFORMED" /> 
                <syncfusion:GridDateTimeColumn MappingName="PROCEDUREDATE" /> 
            </syncfusion:SfDataGrid.Columns> 
        </syncfusion:SfDataGrid> 

We have prepared the sample for your requirement, you can download the same from below mentioned location. 

Sample location: 

You can refer the below UG ink.  

Regards, 
Gnanasownthari T. 
 



MM Muhammad Mobeen March 1, 2017 06:39 AM UTC

Respected Gnanasownthari T. ,

Thanks for your support. It really helpful for me. Now I am out of bottleneck.

Thanks  :)


BR Balamurugan Rajaraman Syncfusion Team March 2, 2017 10:21 AM UTC

HI Muhammad, 
 
Thanks for the update.

Please let us know if you need further assistance on this. 
 
Regards, 
Balamurugan 


Loader.
Up arrow icon