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.
Unfortunately, activation email could not send to your email. Please try again.

Bug on new record with cell non editable

Thread ID:

Created:

Updated:

Platform:

Replies:

129302 Mar 10,2017 07:23 AM Mar 14,2017 08:48 AM WPF 3
loading
Tags: SfDataGrid
Javier
Asked On March 10, 2017 07:23 AM

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

Muthukumar Kalyanasundaram [Syncfusion]
Replied On March 13, 2017 05:42 AM

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 


Ashwini Paranthaman [Syncfusion]
Replied On March 13, 2017 06:00 AM

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. 
 


Muthukumar Kalyanasundaram [Syncfusion]
Replied On March 14, 2017 08:48 AM

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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;