Hi,
[quoted text, click to view] "jarb" <no@spam.net> wrote in message
news:i1y6h.257589$Ry4.13052@newsfe10.phx...
> .Net v1.1
>
> Hello, Not sure what the best way to go about this is. I have a datagrid
> bound to a datatable. One of the columns is a 2 char code. This is how it
> comes from the database. In the datagrid, rather then show the code I
> would like to show a description string that can come from a local lookup
> array. Where should I try to do this mapping? Should I derive a custom
> DataGridColumnStyle for this? Or
Probely the best way, yes. But you could derive from DataGridTextBoxColumn.
I guess the methods to override would be Commit and GetValueAtRow.
GetValueAtRow is used by the DataGridTextBoxColumn to paint the text for the
cells.
You could also use a DataGridComboBoxColumn which isn't included in the
framework but you should be able to find sourcecode for it, and even if you
don't want to use a ComboBoxColum, you might still learn from the code.
[quoted text, click to view] > should I try to do this lower down in the dataadapter? And I need it to
> work both ways.. datagrid should display the description text and allow
> text entry, but the database will send or recv the 2 char code. It should
> never get the description text.
>
> I have a similar situation for some Oracle bool fields that come as Y or N
> chars. Should I derive my own DataGridBoolColumn?
Have you already tried DataGridBoolColumn.TrueValue and FalseValue, seems to
work.
HTH,
Greetings
[quoted text, click to view] >
> thx