AD
Administrator
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