I am creating a SharePoint web part in C# and part of it outputs a GridView control to the page. While I can get fairly extensive control over the way it is displayed by set
Optional! you can also add bootstrap class in code behind like...
protected void gvEmpContactsHistory_SelectedIndexChanged(object sender, EventArgs e)
{
string val = Convert.ToDateTime(gvEmpContactsHistory.SelectedDataKey.Value).ToString("dd-MM-yyyy hh:mm:ss", new System.Globalization.CultureInfo("en-US"));
GetEmployeeDetail(val);
foreach (GridViewRow row in gvEmpContactsHistory.Rows)
{
if (row.RowIndex == gvEmpContactsHistory.SelectedIndex)
{
row.ToolTip = string.Empty;
row.Attributes.Add("class", "btn-success");
}
else
{
row.ToolTip = "Click to select this row.";
row.Attributes.Add("class", "btn-outline-success");
}
}
}