Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
545
Translate WinGrid columns
posted

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

Parents
  • 469350
    Suggested Answer
    Offline posted

    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.

Reply Children