Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Question on template column

Hi,

I have a datagrid DG which will display several columns of data. One of the columns, which is display-only, is a status field showing "Yes" or "No" according to the data value "Y" or "N". So I change the column to a template column and try to add a listBox control with two items added. It seems to be fine until I display it in the browser. I find that I could change the value in the listBox. Although there is no Save button or function to store changes back to database, I would like to know how to prevent the changing of listBox value.

Thank you very much.
[584 byte] By [THL] at [2007-11-11 6:42:24]
# 1 Re: Question on template column
If you don't want the user to be able to change the value, why not just print "Yes" or "No" rather than use a listbox?
Phil Weber at 2007-11-11 23:14:10 >
# 2 Re: Question on template column
Hi Phil Weber,

Thank you and that is a good idea. However, I don't know how to code for printing "Yes"/"No". Do I need to code in the template or ...?

Please advise. Thanks
THL at 2007-11-11 23:15:21 >
# 3 Re: Question on template column
See if this helps:
http://www.syncfusion.com/FAQ/aspnet/WEB_c4c.aspx#q15q
Phil Weber at 2007-11-11 23:16:16 >
# 4 Re: Question on template column
Thanks Phil Weber,

I have read the example and it really gives me some hints. But I would like you to explain a bit further that where should these codes put? If the data value is not "Y"/"N" but is other characters, e.g. "P"/"S"/"T", what should it compare ?

** I am sorry that I make a mistake: This question should be put in .NET Technical instead of ASP.NET.
THL at 2007-11-11 23:17:22 >