<ej:Grid ID="Projects_Grid" runat="server" AllowPaging="true">
<ClientSideEvents DataBound="bound" />
</ej:Grid>
public partial class GridFeatures : System.Web.UI.Page
{
List<Orders> order = new List<Orders>();
public static List<int> pageList = new List<int>();
protected void Page_Load(object sender, EventArgs e)
{
BindDataSource();
pageList.Add(1);
pageList.Add(5);
pageList.Add(10);
pageList.Add(15);
pageList.Add(20);
this.Projects_Grid.PageSettings.PageSizeList = pageList;
}
…………………………………….
} |
|
<ej:Grid ID="Projects_Grid" runat="server" AllowPaging="true">
<ClientSideEvents DataBound="bound" />
</ej:Grid>
<script>
function bound(args) {
// perform your action here
}
</script> |
Good day, how to add "All" in drop down list? thanks
<script type="text/x-jsrender" id="template">
<div class="e-pagercontainer">
<input type="text" id="pager" />
</div>
</script>
<ej:Grid ID="FlatGrid" runat="server" AllowPaging="true" AllowSelection="true" AllowResizeToFit="true" OnServerExcelExporting="FlatGrid_ServerExcelExporting">
<PageSettings ShowDefaults="true" EnableTemplates="true" Template="#template" />
<ClientSideEvents DataBound="databound" /><ej:columns>
…..
</ej:Grid>
<script>
var pagerData = [
{ text: "9", value: 9 },
{ text: "10", value: 10 },
{ text: "11", value: 11 },
{ text: "12", value: 12 },
{ text: "All", value: 40 },
];
function change(args) {
var gridObj = $("#FlatGrid").ejGrid("instance");
gridObj.option({ "pageSettings": { pageSize: parseInt(args.value) } });
gridObj.getPager().find("input").ejDropDownList({
selectedIndex: args.itemId,
change: "change",
dataSource: pagerData
});
}
function databound(args) {
$('#pager').ejDropDownList({
change: "change",
value: this.model.pageSettings.pageSize,
dataSource: pagerData
}); |