• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

help with a datagrid in asp.net and c#

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

kooga_magnum

Member
Joined
Sep 15, 2004
I have a datagrid that is getting values from a database....here is what i need to do: For one particular column of this datagrid everytime a value is 0 I want the value to be "No" and if its 1 to be "Yes",
I cant for the life of me figure this out, any help is much appreciated, thanks!
 
You just want your output in this one column to be either a "yes" or a "no", if the value received is a 1 or a 0.

Code:
if (column == columnYouWant)  {
      if (oneORzero == 1)   
          print "yes"
      else
         print "no"
}
Pseudocode, of course. Would that work?

Adak
 
Last edited:
thats about the right pseudocode its just that its not that easy with a datagrid, they bind all the data at once, rather than column by column and i dont know how to get at those values
 
okay wow, we just did an assignment like this, want my code? we got datagrids on one of the forms... just let me know i will upload. everything is working and i will include the database.
 
Back