|
-
Aug 5th, 2003, 11:06 AM
#1
Thread Starter
Lively Member
Datagrid problems
I'm developing a web based application that displays information about a list of files to a user.
One of the things I want to do is display whether or not the file in question is color or black and white. The database that this information is stored in stores black and white as a boolean value.
What I would like to do is state either the word "Color" (if the boolean is True or "Black and White" if boolean if false in the column, but I'm not sure how to do this. Can anyone give me some help here?
Thanks,
AuldNick
-
Aug 5th, 2003, 11:35 AM
#2
PowerPoster
In the html, put something like this for the text value:
Code:
<%# MyMethod((bool) DataBinder.Eval(Container.DataItem, "Color")) %>
In the code, make a public function that returns a string and accepts a boolean:
Code:
public string MyMethod(bool isColor)
{
if(isColor)
return "Color";
else
return "Black and White";
}
I didn't get to test the code, but you understand don't you?
If you need more help, I can acutally do it in VS and send you the exact code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|