I would like to know that if possible I can set the grid column programatically , like adding new column and setting the grid column like this :
List<GridColumn> col = new List<GridColumn>();
private void LoadSettingValue()
{
col.Add(new GridColumn() { Field = data[0].ts_field_name,
HeaderText =
data[0].
ts_label,
TextAlign = TextAlign.Left,
EditType = EditType.DropDownEdit,
EditorSettings = CustomIDEditParams
}
or it can be like this ?
private void LoadSettingValue()
{
Syncfusion.Blazor.Grids.GridColumn newCol = new GridColumn();
newCol.Field =
data[0]
.ts_field_name;
newCol.HeaderText =
data[0]
.ts_label;
if (
data[0]
.ts_control_type == "TextBox")
{
newCol.EditType = EditType.DefaultEdit;
}
else if (
data[0]
.ts_control_type == "Calendar")
{
newCol.EditType = EditType.DatePickerEdit;
newCol.Format = "{0:dd-MMM-yyyy}";
}
else if (
data[0]
.ts_control_type == "ComboBox")
{
newCol.EditType = EditType.DropDownEdit;
}
col.Add(newCol);
}
Question , both on how do to that programatically , this like creating a setting screen for grid component.
- How to set validation rules ?
- How to set datasource if the grid column edit type =
EditType.DropDownEdit;
Thank you