Hallo,
I bound my grid to a dataset table.
In my column "Type" I have a set of possibile values.
I need to translate each value when I show grid to the user. I mean that i need
- leave in cell.value my code
- replace cell.Text whith the language translation
but i see that cell.Text is readony in InitializeRow event.
What can I do?
I'm using Infragistics 11.2.20112.1010 for Win Forms.
Thanks
Hi,
There are a couple of approaches you can take.
If you have a fixed set of values, then the easiest thing to do would be to use a ValueList. You can create a ValueList and populate it with ValueListItems. Each item has a DataValue and a DisplayText. When you attach this ValueList to the ValueList property of the column, it will handle keeping the Value in the cell and displaying the matching DisplayText to the user.
If you don't want to use a ValueList, then another option would be to hide the real data column and use an unbound column and then handle events of the grid to do the translations. You would use InitializeRow to read the value from the real column and populate the unbound column with whatever string you want. And you could use AfterCellUpdate or maybe BeforeRowUpdate to read the string in the unbound column and update the Value in the real column.
I'm already using a dropdownlist in other columns.
But in this case my column is in readonly mode. So, I need only to show translated value, but leave internal code in it.
Hi maxanziutti,
As Mike has suggested, this behavior may be achieved by implementing a ValueList for the items within the dropdown of your cells.
Please let me know if you have any further questions implementing this approach.
Sincerely,Chris KDeveloper Support EngineerInfragistics, Inc.www.infragistics.com/support
The fact that the column is readonly doesn't matter. You can still use a ValueList.