I have the dynamic webgrid which binds the data from backend dynamically in ASP.NET MVC.. here i want to adjust the width of the first column in that dynamic webgrid.
<style>
.webgrid-header a {
color: white !important;
}
.webgrid-header th {
text-align: center;
}
</style>
@{
var result = new List<dynamic>();
foreach (var emprow in Model)
{
var row = (IDictionary<string, object>)new ExpandoObject();
var eachEmpRow = (Dictionary<string, object>)emprow;
foreach (KeyValuePair<string, object> keyValuePair in eachEmpRow)
{
row.Add(keyValuePair);
}
result.Add(row);
}
var grid = new WebGrid(result, rowsPerPage: 50);
}
@if (@Model != null)
{
@grid.GetHtml(
htmlAttributes: new { id = "grdHoteling" },
tableStyle: "webgrid-table",
headerStyle: "webgrid-header",
footerStyle: "webgrid-footer",
alternatingRowStyle: "webgrid-alternating-row",
selectedRowStyle: "webgrid-selected-row",
rowStyle: "webgrid-row-style",
mode: WebGridPagerModes.All)
}
thanks...!!