Check column

I have tried to bind the column in this way 

 GridSwitchColumn AccColumn = new GridSwitchColumn();
 AccColumn.HeaderText = "ACCANTONAMENTO";
AccColumn.MappingName = "Accantonamento";
AccColumn.Width = 130;
AccColumn.SetBinding(GridSwitchColumn.AllowEditingProperty, new Binding("IsEnableEdit"));
ListArtForNewDoc.Columns.Add(AccColumn);

seems that the binding does not work?
I have to do something else in the behind code?

Alberto C.

1 Reply

JA Jayaraman Ayyanar Syncfusion Team July 26, 2018 08:56 AM UTC

Hi Alberto, 
  
Thanks for contacting Syncfusion support. 
  
We have analyzed your query for binding AllowEditing property is not working for the GridSwitchColumn. You need to refer the source for binding where you are declaring your property which cause binding is not worked in your application and we have also validated by changing property in runitme which is working fine. Refer the below code example. 
  
Code snippet 
GridSwitchColumn AccColumn = new GridSwitchColumn(); 
AccColumn.Width = 130; 
Binding binding = new Binding(); 
binding.Path = "IsEnableEdit"; 
binding.Mode = BindingMode.TwoWay; 
binding.Source = viewModel; 
AccColumn.SetBinding(GridSwitchColumn.AllowEditingProperty,binding); 
AccColumn.MappingName = "IsClosed"; 
  
We have attached the prepared sample and you can download from following link. 
  
Regards, 
Jayaraman. 


Loader.
Up arrow icon