This is a migrated thread and some comments may be shown as answers.

ItemDataBound and GridDropDownColumn question

1 Answer 97 Views
Grid
This is a migrated thread and some comments may be shown as answers.
CSurieux
Top achievements
Rank 2
CSurieux asked on 03 Sep 2008, 01:35 PM
Hello,

I have a column in a DataTable wich cotains a value frm an enum.
To display and editthis value in a radGrid I use a GridDropDownColumn.

But I have some difficulties:

1) It is impossible for me to bind declaratively the DropDown to a table as my values are in an enum, so to insert/modify, I added an ItemDatabound handler where I find the radComboBox by its uniqueName then add RadComboboxItems to it.
Here I have found no way to bind to some table. Its working as this but not very effiscient.
2) when not in Edit mode, I am unable to display in the column containing the int value a text from my enum text rather then an int.
In fact I display nothing.
Previous strategy of finding the RadComboBox and adding items does not work.
I have tryed to find my item and set display text manually, using  e.Item["ItemUniqueName"].Text, but I get " "


Shouldn't all this be automatic ?

Thanks for help.
CS
                   

1 Answer, 1 is accepted

Sort by
0
andy
Top achievements
Rank 1
answered on 03 Sep 2008, 07:58 PM


2) e.item["itemUniqueName"].text giving u weird result, i assume it's not a gridBoundColumn.

Workaround it, "itemUniqueName" remains as it is, but u add one more gridBoundColumn as "itemUniqueNameHIDDEN" set it to visible = false. It act as a Hidden Field.

And use itemUniqueNameHIDDEN when u need the value for displaying manually.

Tags
Grid
Asked by
CSurieux
Top achievements
Rank 2
Answers by
andy
Top achievements
Rank 1
Share this question
or