I am creating an unordered list object based on the information queried from the database.
protected virtual void grdProject_RowDataBound(Object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
BulletedList shipsUL = new BulletedList();
string[] shipIds = e.Row.Cells[4].Text.Split(',');
foreach (string ship in shipIds)
{
shipsUL.Items.Add(ship.Trim());
}
}
}
Once I have created my UL object I want to set the contents of the cell (e.Row.Cells[4]) to the actual list object itself. I have tried an approach with shipsUL.RenderControl but I am confused by the need for HTMLWriters etc.. I come from a PHP background and this concept is strange to me.
Thanks.
I managed to fix this by simply adding the bulletedlist control to the cells child controls:
This seems to replace the original text in the cell which was as I wanted anyway.