I have a column definition in an UltraWebGrid that looks like this...
With uwgStudent.Columns .Add("lHours", "Hours") .With .FromKey("lHours") .Type = Infragistics.WebUI.UltraWebGrid.ColumnType.Custom .EditorControlID = wneHours.UniqueID .CellStyle.HorizontalAlign = HorizontalAlign.Right .DataType = GetType(Decimal).ToString .Format = "0.00" End WithEnd With
When the cell is originally populated the value is displayed using the fomat i.e. 2.00 but after editing the format is redisplayed without a format i.e. 2. If I remove the .Type and .EditorControlID lines it works just fine.
Does anyone have any thoughts or is this just another bug?
Thanks - Terry Hutt
I expect that the Format property of a WebGrid column will probably be ignored by any embeddable editor that doesn't itself have a similar property. WebNumericEdit doesn't have a Format property.
So, what's likely happening is that the grid obeys the Format property when the page is first rendered, but your WebNumericEdit doesn't know what to do with it and thus ignores it.
In this case, try setting the MinDecimalPlaces property of your WebNumericEdit to MinDecimalPlaces.Two. Alternately, you can provide a different NumberFormatInfo object to the NumberFormat property of the WebNumericEdit.