Posted 18 October 2022, 12:38 pm EST
I’ve created a simple FlexGrid that has an ItemSource that starts out empty and once the user clicks a button the data is obtained but the FlexGrid does not update when the ItemSource is updated. If I click the button a second time, it will update the table. I have a method that will get the users project data and I do have StateHasChanged() in this method.
I’m not seeing a setting that will update the table upon changes to the itemsource.
[code]<button class=“btn btn-primary” @onclick=“GetFwUserProjects”>Click me
<FlexGrid ItemsSource="FwUserProjects"
AutoGenerateColumns=false
VerticalScrollBarVisibility="ScrollBarVisibility.Visible"
ColumnHeaderStyle="@("background-color:#1565C0;color:#FFF;font-size:16px;")"
ColumnOptionsMenuVisibility="GridColumnOptionsMenuVisibility.Visible"
MinColumnWidth="85"
Style="@("max-height:50vh")">
<FlexGridColumns>
<GridColumn Binding="name" MinWidth="110" Width="GridLength.Star"/>
<GridDateTimeColumn Binding="created_at" Format="d" Mode="GridDateTimeColumnMode.Date" Header="Created Date"/>
</FlexGridColumns>
</FlexGrid>
[/code]