As I have created dynamic table, now i want to get only gridview column name and place in dynamic table how it's possible?
private string GetUserTaskSheet(GridView grd)
{
string body = string.Empty;
StringBuilder html = new StringBuilder();
html.Append("<table border = '1'>");
html.Append("<tr>");
foreach (GridViewRow row in grd.Rows)
{
html.Append("<th>");
html.Append(row.Cells[1].Text);
html.Append("</th>");
}
html.Append("</tr>");
foreach (GridViewRow row in grd.Rows)
{
html.Append("<tr>");
foreach (GridViewRow column in grd.Columns)
)
{
html.Append("<td>");
html.Append(row[column.ColumnName]);
html.Append("</td>");
}
html.Append("</tr>");
}
html.Append(" ...
Go to the complete details ...