Welcome Guest Search | Active Topics | Sign In | Register

Displaying the Dropdown text in the Grid instead of Value after selection Options
fabraham
Posted: Tuesday, March 15, 2011 11:12:40 AM
Rank: Newbie
Groups: Member

Joined: 3/15/2011
Posts: 3
Hi,
I created a EO grid witih a custom column of dropdown column. The display text and the selected value are different in the dropdown as shown in this demo. It displays the right Text for the user to select before getting the focus for edit.
But once the user selects a value in the drop down and leaves the column, I want the display text to be displayed back , instead the value is displayed. However on postback when I try to get the selectedValue from the grid using (string)e.Item.Cells[1].Value; I want the value not the Text.

To summarize I dont want to display the Values to the user at any point. I might be storing db primary keys which I dont want to expose to the user. But should be accessible to me.
eo_support
Posted: Tuesday, March 15, 2011 11:20:19 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

I am not sure whether I understand your question correctly. If your question is about displaying text, then you can take a look of this sample:

http://demo.essentialobjects.com/Demos/Grid/Features/Custom%20Column/Demo.aspx

And this topic (look for Customize Displaying):

http://doc.essentialobjects.com/library/1/grid/custom_column.aspx

The key is you need to provide a ClientSideGetText handler that returns the actual HTML text you wish to display in the cell based on your cell value. In another word, the grid cell holds the cell value (this is what your code sees), users sees the cell text. ClientSideGetText is what translate cell value to cell text.

Hope this helps.

Thanks!

fabraham
Posted: Tuesday, March 15, 2011 12:01:17 PM
Rank: Newbie
Groups: Member

Joined: 3/15/2011
Posts: 3
Yes they all work fine before the user can edit the drop down. but once the user edit the drop down and leaves the cell, my ClientSideEndEdit method ensures that it returns the cell value, for my future reference.

But this also end up displaying the cell value to the user.

I want to avoid something that is happening here. http://demo.essentialobjects.com/Demos/Grid/Features/Custom%20Column%20-%20Advanced%202/Demo.aspx

The dropdown contains HP #94 Black ink. But if I select that and leave the cell, it is changed to C8765WA. But I want the HP #94 Black ink to stay on the display.

But if in my C# code if I say string)e.Item.Cells[1].Value; I want the cell value, C8765WA in this case.
eo_support
Posted: Tuesday, March 15, 2011 12:06:08 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

I believe our previous reply has already answered your question. Please let us know if any part of our answer does not make sense to you.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.