Hi
I have tried to search for this and have seen some results but with an editable column. I have a grid that has a dataset as it's data source and a decimal column that we current set the format for in the display layout in the bands columns.
I would like to know if you can set the format for a column on a row by row basis because the bands is for all the columns in the data source. Now the rows are read only so it's not like I need to edit the column.
The sample code is below but again it applies to all the columns.
For Each ocolumn As Infragistics.Win.UltraWinGrid.UltraGridColumn In grdAccounts.DisplayLayout.Bands(0).Columns
With ocolumn
Select Case .Key
Case "Current Balance"
If bShowBalances = True Then
.Format = "$#,###,##0.00"
Else
.Format = "$************"
End If
End Select
End Width
Next
I have attached a sample project here which demonstrates how to use embeddable editors to provide a different format for each row and by utilizing the cells 'Editor' property.
Let me know if you have any additional questions.
Thanks for the sample and response. I did see that sample in a previous post so I tried it with setting a format of "$*******" after 2 decimal points and that worked.
However in my production code. I load a dataset, set the grid's data source to said dataset, iterate through the bands and set the format for the column there and then I appeared to hit the row initialize and the format on the band seemed to take precedence over the format I was setting with an editor at the row initialize error.
I'm enclosing a sample application on how we work with the grid. If I comment out the setting of the format on the band's column then the code in the row initialize works.
Thanks again!