Column with Property AllowEditing="False" still editable ?

Dear Syncfusion,

I noticed a very strange behavior. The problem occures on Android and UWP (could not test IOS).
If a column has property AllowEditing="True" , the next column is always editable, even when AllowEditing is set to false !

  <sfGrid:GridTextColumn HeaderText= 'Klant' MappingName='CustomerName' AllowSorting='True' AllowEditing='True'  />
 <sfGrid:GridTextColumn HeaderText='Price VAT exclusive'  MappingName='PriceExclusive' AllowSorting='True' AllowEditing='False'/>


in this exemple the column 'Price VAT exclusive' is editable even I set AllowEditing to False/. When I move the column to another position it cannot be edited anymore.

Please have a look ? Can it be corrected in the November release ?

3 Replies

AN Ashok N Syncfusion Team November 6, 2017 09:55 AM UTC

Hi Asterinex, 
 
Thanks for contacting Syncfuion support. 
 
We have checked your query and while we change the property value from XAML, the property value changes is not notified from framework, so editing was not working while we set AllowEditing is false in Xaml. You can achieve your requirement by setting GridColumn.AllowEditing as False from code behind. Please refer the below code example: 
 
public SfDataGridPage() 
{ 
    InitializeComponent(); 
    dataGrid.Columns[1].AllowEditing = false; 
} 
 
Regards, 
Ashok 



AS asterinex November 14, 2017 08:41 AM UTC

Hello Ashok,

I need different 'AllowEdit''s for different Rows.
I set all Cell's to AllowEditing  = true and then Cancel the

CurrentCellBeginEdit if needed.

         private void DataGrid_CurrentCellBeginEdit(object sender, Syncfusion.SfDataGrid.XForms.GridCurrentCellBeginEditEventArgs args)
        {
             if (this.VC.SelectedItem.IsReadOnly(args.Column.MappingName))
            {
                args.Cancel = true;
            }
        }



Is this approach ok ?



AN Ashok N Syncfusion Team November 15, 2017 09:42 AM UTC

Hi Asterinex,  

Thanks for your update. Yes, you can cancel the Editing to particular GridCell by handling CurrentCellBeginEdit and set the e.Cancel as true based on your requirement with help of event args.  

Please let us know if you require further assistance on this. 

Regards, 
Ashok 


Loader.
Up arrow icon