Skip to content

Instantly share code, notes, and snippets.

@reharik
Created October 25, 2012 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reharik/3954175 to your computer and use it in GitHub Desktop.
Save reharik/3954175 to your computer and use it in GitHub Desktop.
JQGrid using jQGrid's config code
public OrdersJqGridModel()
{
OrdersGrid = new JQGrid
{
Columns = new List()
{
new JQGridColumn { DataField = "OrderID",
// always set PrimaryKey for Add,Edit,Delete operations
// if not set, the first column will be assumed as primary key
PrimaryKey = true,
Editable = false,
Width = 50 },
new JQGridColumn { DataField = "CustomerID",
Editable = true,
Width = 100 },
new JQGridColumn { DataField = "OrderDate",
Editable = true,
Width = 100,
DataFormatString = "{0:yyyy/MM/dd}" },
new JQGridColumn { DataField = "Freight",
Editable = true,
Width = 75 },
new JQGridColumn { DataField = "ShipName",
Editable = true
}
},
Width = Unit.Pixel(640),
Height = Unit.Percentage(100)
};
OrdersGrid.ToolBarSettings.ShowRefreshButton = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment