Question on template column


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Question on template column

  1. #1
    Join Date
    Aug 2005
    Posts
    111

    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.

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    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
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Aug 2005
    Posts
    111
    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

  4. #4
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  5. #5
    Join Date
    Aug 2005
    Posts
    111
    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.
    Last edited by THL; 08-26-2005 at 05:12 AM.

Similar Threads

  1. Template Column and Image
    By neo00 in forum ASP.NET
    Replies: 2
    Last Post: 06-16-2005, 11:46 AM
  2. Template column
    By sriramKumar in forum .NET
    Replies: 1
    Last Post: 05-07-2005, 11:57 AM
  3. Datagrid column question
    By Philip Rayne in forum ASP.NET
    Replies: 1
    Last Post: 10-11-2002, 11:25 AM
  4. XSD question
    By Dave Kraft in forum XML
    Replies: 0
    Last Post: 01-10-2002, 10:08 AM
  5. Table column names question
    By Yury in forum Database
    Replies: 2
    Last Post: 11-16-2001, 10:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center