JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Data Grid › Grid Re-render › Reply To: Grid Re-render
Hi,
I updated to the latest version, but it still wasn’t working. However, I ended up getting it to work by calling
grid.StateHasChanged();
await Task.Delay(1);
grid.Render();
These are my grid properties just in case. Thank you so much for your help!
<Grid @ref=”grid” id=”io-page-grid” DataSource=”@expandoAssets” Appearance=”@appearance” Selection=”@selection” Header=”@header”
Grouping=”@grouping” ColumnGroups=”@columnGroups” Behavior=”@behavior” OnCommand=”@OnCommand” Columns=”columns” Layout=”@gridLayout”
Editing=”@editing” OnEndEdit=”@EditRow” OnRowRemoved=”@RemoveRow” ColumnMenu=”@columnMenu” Messages=”@columnMenuMessages”>
</Grid>
GridAppearance appearance = new GridAppearance() { ShowColumnGroupsInColumnPanel = true, ShowRowHeaderNumber = true, ShowColumnIcon = true };
GridSelection selection = new GridSelection() { Enabled = false };
GridBehavior behavior = new GridBehavior() { AllowColumnReorder = true, AllowColumnFreeze = true };
GridGrouping grouping = new GridGrouping() { Enabled = true, GroupIndent = 0, SummaryRow = new GridGroupingSummaryRow() { Visible = false } };
GridHeader header = new GridHeader() { Visible = true, Buttons = new string[] { “search”, “format” } };
GridLayout gridLayout = new GridLayout() { ColumnWidth = “auto”, RowHeight = “auto” };
GridEditing editing = new GridEditing()
{
Enabled = true,
Mode = GridEditingMode.Cell,
CommandColumn = new GridEditingCommandColumn()
{
Visible = true,
DataSource = new GridEditingCommandColumnDataSource()
{
CommandColumnCustom = new GridCommand()
{
Icon = “smart-icon-star”,
Command = “notify”,
Visible = true,
Label = “Notify Me”
}
}
}
};
GridColumnMenu columnMenu = new GridColumnMenu()
{
Enabled = true,
DataSource = new GridColumnMenuDataSource()
{
ColumnMenuCustomizeType = new GridCommand() { Visible = true },
ColumnMenuItemHide = new GridCommand() { Visible = true },
ColumnMenuItemDelete = new GridCommand() { Visible = true },
ColumnMenuItemGroupBy = new GridCommand() { Visible = false }
}
};
Dictionary<string, object> columnMenuMessages = new()
{
{
“en”, new Dictionary<string, object>()
{
{“columnMenuCustomizeType”, “Edit Column” },
{“columnMenuItemHide”, “Option B” },
{“columnMenuItemDelete”, “Option C” }
}
}
};