I want a decimal input column in wingrid prefixed with $ symbol.
Please find the below picture for reference
Hi,
You can do with using the Format property on the column. Assuming that the DataType of the column is a numeric type, like decimal / currency, you could do something as simple as this:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridBand band = layout.Bands[0]; band.Columns["Decimal 1"].Format = "c"; }
The "c" format will format the value as currency using the current system settings. For other number format options, check out Microsoft's documentation:
Standard Numeric Format Strings
Custom Numeric Format Strings
Thanks!
I have tried this code but it doesn't work, I want to have 2 decimals with $ prefixed.
Private Sub ugMainManageGangMembers_InitializeLayout(sender As Object, e As InitializeLayoutEventArgs) Handles ugMainManageGangMembers.InitializeLayout e.Layout.Bands(0).Columns("GangLaborId").Hidden = True e.Layout.Bands(0).Columns("Title").Width = 150 e.Layout.Bands(0).Columns("Reg.$/hour").Format = "c"
End Sub
Please find attachment