Infragistics ultrawingrid cell-level formatting -
i have infragistics ultrawingrid bound datasource contains amount (decimal) , currency (string). need display amount , currency formatted:
data source: grid contents: amount currency amount 12.34 eur eur 12.34 22.33 usd usd 22.33
i thinking 3 options:
- populate "amount" column in grid formatted string. don't option because mess sorting of decimal values.
- set editor on each cell (cell, not column!) in initializerow event. however, don't know editor suitable - ideas?
- format amount column (column level!) in initializelayout method somehow dependant on currency column (the currency column exists in grid hidden column) - don't know if possible - know how? or there other suggestions?
i have done using option 2 using editorwithtext
. have 2 columns in row - decimal value
column , string formatstring
column. here's did have independent formatting in value
column.
grid.initializerow += (sender, e) => { defaulteditorownersettings settings = new defaulteditorownersettings(); settings.datatype = typeof(decimal); settings.format = (string)e.row.cells["formatstring"].value; editorwithtext editor = new editorwithtext(new defaulteditorowner(settings)); e.row.cells["value"].editor = editor; }
Comments
Post a Comment