I want to set different - different width and alignment in all the columns in WEBGRID in MVC 3. It means that In the above code I have 5 columns now I want to set different alignment and width of all the headers.
Below is my code :
@{WebGrid grid = new WebGrid();
if (@Model.VendorItemsList != null)
{
grid = new WebGrid(source: @Model.VendorItemsList, ajaxUpdateContainerId: "gridSearch", canSort: true, rowsPerPage: Model.PageSize);
}
}
<div id="gridSearch" class="tableGrid">
@{
@grid.GetHtml(
mode: WebGridPagerModes.All,
columns: grid.Columns(
grid.Column("VendorItemName", header: @GeneralResource.Vendor + " " + @GeneralResource.Item + " " + @GeneralResource.Name),
grid.Column("ItemName", header: @GeneralResource.Item),
grid.Column("ItemCategoryName", header: @GeneralResource.Category),
grid.Column("VendorName", header: @GeneralResource.Vendor)
))
}
}
</div>