Hi can anyone kindly attach me here a sample application in MVC3 razor(.cshtml) with igGrid enabled with Column Hiding functionality?
I'm getting issues when trying to enable the hiding feature. Kind help pls.
Hi,
You will find the file "iggrid_hide.zip" an example (in Javascript).
1. Column CompanyName cannot be hidden
{ columnKey: "CompanyName", allowHiding: false },
2. Hidden column that can never be displayed
{ columnKey: "CustomerID", allowHiding: false, hidden: true },
Hoping that it'll help you,
Olivier Hélin
Hi. Many thanks for your quick response. But i'm loading the Grid differently and i'm not using javascript for enabling the features. Please see the attachment.
If i enable hiding then i'm getting error as "Microsoft JScript runtime error: No such widget loaded: igGridHiding". Any idea why this error is coming?
Hello guys,
Thank you for posting in our community!
I have added bellow a possible implementation on column hiding(see code in bold):
@(Html.Infragistics().Grid(Model).ID("grid1").Columns(column =>
{
column.For(x => x.ProductID).HeaderText(this.GetGlobalResourceObject
("Grid", "PRODUCT_ID").ToString());
column.For(x => x.Name).HeaderText(this.GetGlobalResourceObject
("Grid", "PRODUCT_NAME").ToString());
column.For(x => x.ReorderPoint).HeaderText(this.GetGlobalResourceObject
("Grid", "REORDER_POINT").ToString());
column.For(x => x.ProductNumber).HeaderText(this.GetGlobalResourceObject
("Grid", "PRODUCT_NUMBER").ToString());
column.For(x => x.ListPrice).HeaderText(this.GetGlobalResourceObject
("Grid", "LIST_PRICE").ToString()).DataType("number");
column.For(x => x.Color).HeaderText(this.GetGlobalResourceObject
("Grid", "COLOR").ToString());
column.For(x => x.StandardCost).HeaderText(this.GetGlobalResourceObject
("Grid", "STANDARD_COST").ToString());
})
.Features(features => { features.Hiding().ColumnSettings
(settings => settings.ColumnSetting().ColumnKey("ReorderPoint")
.Hidden(true).AllowHiding(true)); })
.DataSourceUrl(Url.Action("GridColumnHiding")).Height("400").DataBind().Render())
You might be interested in the following resource where could be found more details on the column hiding feature and the whole sample: http://es.infragistics.com/products/jquery/sample/grid/column-hiding-basic