I'm using a RadGrid in a multi-language/multi-cultural web application. This grid contains columns with fractional Width values and am seeing the rendered HTML is invalid when the page's culture is set to one that uses commas for decimal places. To recreate the issue, I created a very simple web app with a RadGrid and added a GridDateTimeColumn defined like this:
<telerik:RadGrid runat="server" ID="RadGrid1">
<MasterTableView>
<Columns>
<telerik:GridDateTimeColumn HeaderStyle-Width="10.5em" UniqueName="Col1" DataField="Col1" />
<telerik:GridDateTimeColumn HeaderStyle-Width="15.8em" UniqueName="Col2" DataField="Col2" />
</Columns>
</MasterTableView>
</telerik:RadGrid>
When setting the Page's Culture property to one that uses a comma as the decimal place (for example "fr-FR") the rendered grid also has the format applied to the property value, which is certainly undesirable. In Internet Explorer, these invalid strings are ignored and replaced with an empty property value, however Chrome renders these grids as follows:
<table class="rgMasterTable" id="RadGrid1_ctl00" style="width:100%;table-layout:auto;empty-cells:show;">
<colgroup>
<col style="width:10,5em" />
<col style="width:15,8em" />
</colgroup>
<thead>
While the browsers appear to output some default column widths (thus ignoring the invalid values), where things really go wrong is when trying to persist the grid's settings using a RadPersistenceManager. When trying to reload the grid's columns widths, an error is encountered due to trying to load the invalid number formats, or in other cases the grid is rendered with the columns completely missing from the display.
I'm not sure if it's against best practice to use fractional values for Width properties, but we have done this in a number of places in our application and it does not appear to be a problem with generic ASP.NET controls such as GridViews where they aren't trying to apply a format to a property value.
I would appreciate some guidance... are we violating a best practice, missing something obvious, or is this a bug in the RadGrid, column control, or (less likely) the RadPersistenceManager?
I'm running the 2016-Q2 release of the controls and am developing in a .NET 4.5 application.
<telerik:RadGrid runat="server" ID="RadGrid1">
<MasterTableView>
<Columns>
<telerik:GridDateTimeColumn HeaderStyle-Width="10.5em" UniqueName="Col1" DataField="Col1" />
<telerik:GridDateTimeColumn HeaderStyle-Width="15.8em" UniqueName="Col2" DataField="Col2" />
</Columns>
</MasterTableView>
</telerik:RadGrid>
When setting the Page's Culture property to one that uses a comma as the decimal place (for example "fr-FR") the rendered grid also has the format applied to the property value, which is certainly undesirable. In Internet Explorer, these invalid strings are ignored and replaced with an empty property value, however Chrome renders these grids as follows:
<table class="rgMasterTable" id="RadGrid1_ctl00" style="width:100%;table-layout:auto;empty-cells:show;">
<colgroup>
<col style="width:10,5em" />
<col style="width:15,8em" />
</colgroup>
<thead>
While the browsers appear to output some default column widths (thus ignoring the invalid values), where things really go wrong is when trying to persist the grid's settings using a RadPersistenceManager. When trying to reload the grid's columns widths, an error is encountered due to trying to load the invalid number formats, or in other cases the grid is rendered with the columns completely missing from the display.
I'm not sure if it's against best practice to use fractional values for Width properties, but we have done this in a number of places in our application and it does not appear to be a problem with generic ASP.NET controls such as GridViews where they aren't trying to apply a format to a property value.
I would appreciate some guidance... are we violating a best practice, missing something obvious, or is this a bug in the RadGrid, column control, or (less likely) the RadPersistenceManager?
I'm running the 2016-Q2 release of the controls and am developing in a .NET 4.5 application.