I know there are a number of posts already on this, but I've been through them all and am going round in circles. I have a datagrid, with a numeric column and a hidden string column that contains a format I want to apply to each cell of the numeric column. I have a handler executing on the InitializeRow event of the datagrid, with the following code ...
Private Sub DataGridInitializeRowHandler _ (ByVal sender As Object, _ ByVal e As Infragistics.Win.UltraWinGrid.InitializeRowEventArgs) Dim band As UltraGridBand = DataGrid.DisplayLayout.Bands(0) Dim ColumnName as String = GetColumnName Dim Format As String = e.Row.GetCellText(band.Columns("Format")) Dim editor As Infragistics.Win.EmbeddableEditorBase = EditorCache.GetEditor(Format) e.Row.Cells(SummaryColumn.ColumnName).Editor = editor End Sub
My Format variable is being successfully populated with values such as {0:$#,##0.00} and {0:##.##%}, the editor EmbeddableEditorBase object is correctly created and assigned, but the format of the objects in the grid never changes.
Any pointers as to what I'm missing or doing wrong would be very much appreciated.
ThanksNick
OK, solved this myself if anyone esle comes across a similar issue. Elsewhere in my code I wassetting the column format property. If I removed this line it works.
DataGrid.DisplayLayout.Bands(0).Columns(ColumnName).Format = sFormat
One other small point, the format string shouldn't include the type specification. Needed to change mine to be $#,##0.00 and ##.##%
Hello DataPA,
Thank you for your feedback and for sharing this with our community.
Please do not hesitate to ask if something comes up.