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

Bug on new record with cell non editable

When I configure a SfDataGrid with EditTrigger="OnTap" and have columns binding with AllowEditing="False" AllowFocus="False"
If I click on columns with allowediting = false in a new row, this cell has focus, and can't edit

3 Replies

MK Muthukumar Kalyanasundaram Syncfusion Team March 13, 2017 09:42 AM UTC

Hi Javier, 

Thank you for contacting Syncfusion support. 

We have checked your query. We are not able to reproduce the reported “AddNewRow cell are not editable when we set AllowFocus and AllowEditable as false” in our side. For your reference, we have attached the sample in below location. In the attached sample, AddNewRow record cell has been focused and editable. Could you please refer it. 


If you are still facing the issue, could you please revert by modifying the attached sample based on your application along with the replication procedure?.  And could you please provide your current Syncfusion product version, it will helpful for us to analyze further.  

Please let us know if you have any query. 

Regards, 
Muthukumar K 



AP Ashwini Paranthaman Syncfusion Team March 13, 2017 10:00 AM UTC

From: Javier 
Sent: Monday, March 13, 2017 5:54 AM
To: Syncfusion Support
Subject: RE: Syncfusion support community forum 129302, Bug on new record with cell non editable, has been updated.
 

Change Xaml Code from example by : 
 
       <syncfusion:SfDataGrid x:Name="dataGrid"  
                               Grid.Column="0" AddNewRowPosition="Top" 
                               AllowEditing="True" 
                               EditTrigger="OnTap"  
                               AutoGenerateColumns="False" 
                               ItemsSource="{Binding Path=OrdersDetails}" 
                               SelectionMode="Single"  
                               SelectionUnit="Row" 
                               ShowGroupDropArea="True"> 
            <syncfusion:SfDataGrid.Columns> 
                <syncfusion:GridTextColumn MappingName="OrderID" AllowFocus="False" AllowEditing="False" /> 
                <syncfusion:GridTextColumn MappingName="CustomerID" AllowFocus="True" AllowEditing="True" /> 
                <syncfusion:GridDateTimeColumn Width="200" AllowFocus="False" AllowEditing="False" 
                                               HeaderText="Shipping Date" 
                                               MappingName="ShippingDate" 
                                               TextAlignment="Right" /> 
                <syncfusion:GridTextColumn MappingName="EmployeeID" TextAlignment="Right" AllowEditing="False" AllowFocus="False" /> 
                <syncfusion:GridTextColumn HeaderText="Ship City" MappingName="ShipCity" AllowEditing="True" AllowFocus="True"/> 
                <syncfusion:GridTextColumn HeaderText="Ship Country" MappingName="ShipCountry" AllowEditing="False" AllowFocus="False"/> 
                <syncfusion:GridTextColumn MappingName="Freight" TextAlignment="Right" AllowEditing="True" AllowFocus="True" /> 
                <syncfusion:GridCheckBoxColumn HeaderText="Closed" MappingName="IsClosed"  AllowEditing="False" AllowFocus="False" /> 
            </syncfusion:SfDataGrid.Columns> 
        </syncfusion:SfDataGrid> 
 
For example, I want edit only three cells. 
On new row, I can edit all cells, and can have focus 
 
You can reproduce the error. 
 



MK Muthukumar Kalyanasundaram Syncfusion Team March 14, 2017 12:48 PM UTC

Hi Javier, 
 
Thanks for the update. 
 
We have analyzed your query. You can achieve your requirement by handling CurrentCellBeginEdit  and  CurrentCellActivating event. For your reference, we have attached the code snippet and sample in below location. Could you please refer it. 
 
Code Snippet: 
 
// to disable the editmode of addnewrow in sfgrid 
 
this.dataGrid.CurrentCellBeginEdit += dataGrid_CurrentCellBeginEdit; 
 
void dataGrid_CurrentCellBeginEdit(object sender, CurrentCellBeginEditEventArgs args) 
{ 
    if (this.dataGrid.IsAddNewIndex(args.RowColumnIndex.RowIndex)) 
    {         
        args.Cancel = !args.Column.AllowEditing; 
    } 
} 
 
// to disable the focus of addnewrow in sfgrid 
 
this.dataGrid.CurrentCellActivating += DataGrid_CurrentCellActivating; 
 
private void DataGrid_CurrentCellActivating(object sender, CurrentCellActivatingEventArgs e) 
{ 
    if (this.dataGrid.IsAddNewIndex(e.CurrentRowColumnIndex.RowIndex)) 
    { 
        var col = e.CurrentRowColumnIndex.ColumnIndex; 
        var focus = this.dataGrid.GetDataColumnBase(e.CurrentRowColumnIndex); 
        e.Cancel = !focus.GridColumn.AllowFocus; 
    }  
} 
 
 
 
To disable the editmode of addnewrow in SfDataGrid. Please refer the below link, 
 
 
Please let us know if you have any query. 
 
Regards, 
Muthukumar K 


Loader.
Up arrow icon