The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi,
Am adding a new row to the grouping grid on click of a button.In this new row,I need to make only the 3rd column editable and the remaining readonly.
I am able to achieve this partially by using grd1_QueryCellStyleInfo event and making :
if(e.TableCellIdentity .ColIndex == 3)
e.Style.ReadOnly = false;
The problem is that then the 3rd column of ALL the rows become editable.
Doing (e.TableCellIdentity .RowIndex== 0 && e.TableCellIdentity .ColIndex == 0) doesnt work.
ADAdministrator Syncfusion Team June 22, 2006 10:20 PM UTC
Hi Sh,
Regarding AddNewRecord :
Could you try this code in QueryCellInfo event to make a cell as readonly cell in a grid. Here is a code snippet.
if(e.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.AddNewRecord )
{
if(e.TableCellIdentity.ColIndex == 3)
{
e.Style.Readonly = false;
}
else
e.Style.Readonly = true;
}
Regarding Newly Added Record:
You need to handle the SourceListRecordChanging event to find the newly added record and set the readonly property of the record in QuerycellInfo event. Please find the code snippet.
Record NewRecord = null;
private void gridGroupingControl1_SourceListRecordChanging(object sender, Syncfusion.Grouping.RecordChangedEventArgs e)
{
if( e.Action = RecordChangedType.Added )
{
NewRecord = e.Record;
}
}
if( NewRecord != null && NewRecord == e.TableCellIdentity.DisplayElement.ParentRecord)
{
if(e.TableCellIdentity.ColIndex == 3)
{
e.Style.Readonly = false;
}
else
e.Style.Readonly = true;
}
Here is a sample.
http://www.syncfusion.com/Support/user/uploads/AddNewRecord_994b98ae.zip
Let me know if this helps.
Best Regards,
Haneef