Is it possible to write a LIST to a datagrid? I have a LIST that contains a list of attribute names that I want to display in datagrid row. For example sortedList:
attributeTtitle
Color
Size
Length
I want to list this to a datagrid or some type of table so that the is aligned horizontally like this:
Color Size Length
Currently, I am writing this LIST to an EXCEL record like beow:
var sortedList = FilteredValueOfProduct.OrderBy(prod => prod.attributeTtitle).ToList(); foreach (var item in sortedList) { HttpContext.Current.Response.Write("<Td>"); //Get column headers and make it as bold in excel columns HttpContext.Current.Response.Write("<B>"); HttpContext.Current.Response.Write(item.attributeTtitle.ToString()); HttpContext.Current.Response.Write("</B>"); HttpContext.Current.Response.Write("</Td>"); }