Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Figuring out what each cell means in GridView
Message
From
31/07/2008 20:30:59
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01335562
Message ID:
01335711
Views:
11
>Nice idea, thanks a lot. For now I don't need this anymore, since I was able to achieve my goal differently.

And how did you accomplish it? Others might like to know for future reference ...

~~Bonnie



>
>It's amazing, actually, how some simple things turn to be quite difficult in ASP.NET
>
>>Do the Phone, City , etc columns have to be determined programmatically? If yes, maybe you could set page level int properties for the desired columns and then loop through the Header row of the gridview to see if the column name is the one you want then set the page property. Then, in your data row loop check to see if the current cell is one of the columns you want to set.
>>
>>>Hi everybody,
>>>
>>>I have this code
>>>
>>>for (int i = 4; i < e.Row.Cells.Count; i++)
>>>            {
>>>                e.Row.Cells[i].Attributes.Add("style", "word-wrap:break-word;width:70px");
>>>            }
>>>
>>>However, I only want to execute this code for particular columns (Phone, City, etc.). Can I figure out which cell I'm in?
>>>
>>>Also is there something like INLIST or myValue IN (...) in C# if I want to check a value against number of items?
>>>
>>>Thanks in advance.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform