Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146768 | Aug 19,2019 07:06 AM UTC | Sep 2,2019 12:04 PM UTC | ASP.NET Web Forms | 3 |
![]() |
Tags: Grid |
// Client End
………………………………..
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
<ContentTemplate>
<ej:Grid ID="mainGrid" ……………..>
……………………………………
<ClientSideEvents DataBound="mainGridDataBound" />
……………….
<Columns>
……………………………..
</Columns>
</ej:Grid>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="col-lg-3 bg-transparent">
<div id="UsersContainer" style="height: 100%; width: 100%">
<asp:UpdatePanel ID="UpdatePanel4" runat="server" UpdateMode="Always">
<ContentTemplate>
<ej:Grid ID="userNumberGrid" ………….>
……………………
<ClientSideEvents DataBound="userNumberGridDataBound" />
…………………….
<Columns>
……………………
</Columns>
</ej:Grid>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="col-lg-3 bg-transparent">
<div id="freeGridContainer" style="height: 100%; width: 100%">
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Always">
<ContentTemplate>
<ej:Grid ID="freeNumberGrid" ………..>
……………………………………………………………..
<Columns>
…………………………………
</Columns>
</ej:Grid>
<script>
var flag1, flag2 = false;
function mainGridDataBound() {
flag1 = true;
if (flag1 && flag2)
webmethod();
}
function userNumberGridDataBound() {
flag2 = true;
if (flag1 && flag2)
webmethod();
}
function webmethod() {
$.ajax(
{
type: "POST",
contentType: 'application/json; charset=utf-8',
url: 'Default.aspx/freeNumberGridData',
dataType: 'json',
success: function (data) { // get the data from here.
var gridobj = $("#<%= freeNumberGrid.ClientID %>").ejGrid("instance"); // take the grid instance using grid id.
gridobj.dataSource(data.d); // update the dataSource for third grid using dataSource method of ejGrid.
},
});
}
</script>
</ContentTemplate>
</asp:UpdatePanel>
// CodeBehind
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public static object freeNumberGridData()
{
// do your stuff and return the data
return data;
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.