We are using ultrawinGrid.WinGrid in my windows form and we are not able to set format for a particular rows’s cell value. Please find the below scenario :
Value 1
Value 2
row 1
10,000.00
row 2
16,849.00
89,236.00
row 3
21,235.00
87,329.00
row 4
88%
74%
row 5
14,234.00
25,547.00
In the above table all the rows will be in decimal format but we need display 4th row in percentage format.
Kindly provide soultion for this.
private void ultraGrid1_InitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Index == 3) { var editorSettings = new DefaultEditorOwnerSettings(); editorSettings.DataType = typeof(Decimal); editorSettings.Format = "0'%"; var editor = new EditorWithText(new DefaultEditorOwner(editorSettings)); e.Row.Cells["Value 1"].Editor = editor; e.Row.Cells["Value 2"].Editor = editor;
} }
Please note that formatting only applies to a cell that is NOT in edit mode. If the cell is editable by the user and you need different masks based on the row, then you would have to use an editor - like an UltraMaskEditor or UltraNumericEditor control and set the Editor/EditorComponent on the cell.
Hi,
We have tried the sample code which have provided in C#.net and converted to VB.net and tried we are not getting the expected format.
can you please provide sample vb.net project code for the same.