Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Data Text Fields in DataGrid

Status
Not open for further replies.

GavW

Programmer
Jan 13, 2006
58
GB
Hey All!

I am creating a web forum in C# and have come across a problem whereby i am unable to store two field values in the same cell of a datagrid.

An example of one of the columns in my datagrid looks like the following:

BoundColumn user = new BoundColumn();
user.DataField = "User";
user.DataFormatString = "{0}";
user.HeaderText = "User";

Now if for example i wanted to add the number of posts that the user has posted underneath their username how would i incorporate this "posts" field into the same datagrid cell.

Thanks in advance

GavW
 
The easiest way (if the number of posts is another column in your datasource) is probably to combine them into an additional field in your SQL Statement.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top