Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
147402 | Sep 9,2019 03:45 PM UTC | Jan 3,2020 07:25 AM UTC | Xamarin.Forms | 19 |
![]() |
Tags: SfDataGrid |
[MainPage.Xaml.cs]
private void Grid_GridLoaded(object sender, GridLoadedEventArgs e)
{
//You can get the generated column inside this event
//var columnsCount = this.Grid.Columns.Count();
} |
|
We are able to reproduce the issue “When HeaderText property value is set from GridLoaded event value is not updated” in above Xamarin forms version 4.1. Here we noticed Runtime changes for bindable property does not work in Forms version 4.2 and above, hence issue is due to Xamarin forms FrameWork break. Already we have logged the bug report to Xamarin team. For further reference we have added the frame work bug link here.
Frame work bug link:
https://github.com/xamarin/Xamarin.Forms/issues/8860
[C#]
---
Grid.AutoGeneratingColumn += Grid_AutoGeneratingColumn;
private void Grid_AutoGeneratingColumn(object sender, AutoGeneratingColumnEventArgs e)
{
if (e.Column.MappingName == "OrderID")
{
e.Column.HeaderText = "ID";
}
else if (e.Column.MappingName == "CustomerID")
{
e.Column.HeaderText = "Customer ID";
}
else if(e.Column.MappingName == "CustomerName")
{
e.Column.HeaderText = "Name";
}
else if (e.Column.MappingName == "ShipCountry")
{
e.Column.HeaderText = "Country";
}
else if (e.Column.MappingName == "ShipCity")
{
e.Column.HeaderText = "City";
}
}
--- |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.