Hi KHALID,
Thanks for the update.
We have checked the reported query at our end. Also we have checked our dashboard sample enum localization to check the reported issue. Unfortunately we could reproduce the reported issue at our end.
Can you please check the attached sample and let us know that whether we missed anything to reproduce the issue at our end. So that, we could analyse further to provide you a better solution at the earliest.Sample link : https://www.syncfusion.com/downloads/support/directtrac/general/ze/Enum_Localization109299961.zipRegards,Balamurugan Thirumalaikumar
i check your example and i found the behavior of data grid change when set the datasource to list and set to datatable , i modified the sample you provided to show the error when setting the datasource to list |
We have checked this query, as per the current implementation of GridGrouping control’s DefaultValue property derived in string type. And also we can not change the DefaultValue In run time to the type of enum. |
i'm watching CurrentRecordContextChange and check if table name equal to parent and if table name equal to child to set the default data from the previous record
i success with parent table
with child table i got addnew not called and i'm sure i called it |
Meantime we could understand this first query and reproduce the issue with child table, we have forwarded this query to our development team for further validation will update you the proper details on February 23,2021. We appreciate your patience till then. |
private void GridGroupingControl1_CurrentRecordContextChange(object sender, Syncfusion.Grouping.CurrentRecordContextChangeEventArgs e)
{
if (e.Action == Syncfusion.Grouping.CurrentRecordAction.EnterRecordComplete &
e.Record != null && e.Record.Kind == Syncfusion.Grouping.DisplayElementKind.AddNewRecord)
{
//Code to update parent table record.
if (e.Table.TableDescriptor.Name == "DataTexts")
{
int currRowIndex = e.Table.CurrentElement.GetRowIndex();
DataTexts lastDataText = null;
for (int i = currRowIndex - 1; i >= 3; i--)
{
if (ggc.Table.DisplayElements[i].ParentRecord.GetData() is DataTexts cdt)
{
lastDataText = cdt;
break;
}
}
DataTexts newDataText = new DataTexts();
if (lastDataText == null)
{
newDataText.Direction = Position.Left;
newDataText.Order = 1;
}
else
{
newDataText.Direction = lastDataText.Direction;
newDataText.Order = lastDataText.Order + 1;
}
var table = gridGroupingControl1.GetTable("DataTexts");
if (table != null)
{
table.AddNew();
foreach (PropertyInfo Propinfo in typeof(DataTexts).GetProperties())
{
if (Propinfo.CanWrite)
{
//table.AddNewRecord.SetValue(Propinfo.Name, Propinfo.GetValue(newDataText)); // here i got 'AddNew not called'
table.TableDescriptor.Fields[Propinfo.Name].DefaultValue = Propinfo.GetValue(newDataText).ToString();
}
}
}
}
}
if (e.Action == Syncfusion.Grouping.CurrentRecordAction.LeaveRecordComplete &
e.Record != null && e.Record.Kind == Syncfusion.Grouping.DisplayElementKind.AddNewRecord)
{
if (e.Table.TableDescriptor.Name == "DataTexts")
{
var table = gridGroupingControl1.GetTable("DataTexts");
if (table != null)
{
table.AddNew();
foreach (PropertyInfo Propinfo in typeof(DataTexts).GetProperties())
{
if (Propinfo.CanWrite)
{
table.TableDescriptor.Fields[Propinfo.Name].DefaultValue = "";
}
}
}
}
}
} |