It is possible to achieve different decimal places by handling the CellEditorInitialized event and setting the DecimalPlaces property to the currently activated editor:
PrivateSub RadGridView1_CellEditorInitialized(sender AsObject, e As GridViewCellEventArgs) Handles RadGridView1.CellEditorInitialized
Dim spinEditor As GridSpinEditor = TryCast(e.ActiveEditor, GridSpinEditor)
If spinEditor IsNotNothingThen
spinEditor.DecimalPlaces = e.RowIndex
EndIfEndSub
The attached gif file illustrates the achieved result.
I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
In my case, my radgridview Column is not editable,So in the read-only mode same decimal places are shown
Dess | Tech Support Engineer, Principal
Telerik team
commented on 19 Aug 2021, 06:52 AM
Hi, George,
If you need to format the values displayed in the cells while they are not being in edit mode, it is suitable to use the CellFormatting event and specify the CellElement.Text property:
Dim parsedValue AsDecimalPrivateSub RadGridView1_CellFormatting(sender AsObject, e As CellFormattingEventArgs)
If e.CellElement.ColumnInfo.Name = "UnitPrice"AndAlso e.CellElement.Value IsNotNothingThen
parsedValue = Decimal.Parse(e.CellElement.Value)
e.CellElement.Text = parsedValue.ToString("N" & e.RowIndex)
EndIfEndSub