Link to home
Start Free TrialLog in
Avatar of deepPowdah
deepPowdahFlag for United States of America

asked on

ASP.net 3.5 Lookup field strategy

Our strategy for lookup fields is to use a short code for the value of a lookup field (max 4 chars) and use a 50 varchar value to display in a drop down field.  To do this we create a lookup table with the value and display fields.  This has worked well in other development environments but not in ASP.net so far.  

Using a form view in the Item Template.  The system wants to display the value (short value) in a label, but we would like to display the long value in the field.  So I have added drop down lists for these fields by editing the field templates.  All is well except it allows the user to modify the value, although the new value is not posted.  This will confuse the users.  So I tried enable="false."  this works but the field is grayed out.  Looks wierd.  

Is there any way around this using the drop down list.  In Access for example there is an enabled property and locked property.  Lock does not gray out field.   Can't find a lock or anything that should do what I need.  Am I missing something?

Is it best just to save the long value in the underlying table and forget about short values?

Any other strategies?

Thanks for your help
Avatar of Alfred A.
Alfred A.
Flag of Australia image

Hi,

Why don't you change the BackColor of the Control to let say White?
Avatar of deepPowdah

ASKER

it isn't the back color is the container for the drop list.
Can you please clarify?  You have a label and a dropdownlist, right?  Or, do you have a panel as a container with label and dropdownlist in there? So, which control/container is being grayed out when Enabled="false"?
The border of the dropdown list is being grayed out.  It think it looks strange.  On the Item Template all text box fields appear as lablels and have no borders and the text is normal,black.  I would like the text to appear as in other fields black, and no dropdown list control displayed.
ASKER CERTIFIED SOLUTION
Avatar of Alfred A.
Alfred A.
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
THanks for your help.  after spending the weekend on this matter, it is clear that the dropdown list does not have the attributes needed to accomplish this.  I guess I will just have to use it and insert a javascipt function to prevent changing the value.

After all the hype about .Net 3.5 I'm disappointed.