open dialog box select customer and fill txtcustomer after that add / edit OrdersGrid (main grid) records
Issue is
after add /edit records Ordergrid not display in the page but Dialogbox displaying (no need to show Dialogbox in page)
<input type="text" class="form-control" id="txtcustomer" runat="server" readonly="true" style="background-color: #fff;" placeholder="customer here" />
<button id="btn" type="button" class="btn btn-info">...</button>
<ej:Dialog ID="Dialog" ClientIDMode="Static" ClientSideOnBeforeOpen="open" ActionButtons="close,search" ShowOnInit="false" EnableModal="true" Target="#OrdersGrid" runat="server" Title="SearchGrid">
<DialogContent>
<ej:Grid ID="PopupGrid" runat="server" ClientIDMode="Static" >
<PageSettings PageSize="3" />
<Columns>
<ej:Column Field="CustomerName" HeaderText="Customer name" />
<ej:Column Field="CustomerCode" HeaderText="Customer ID">
</ej:Column>
</Columns>
<ClientSideEvents RowSelected="rowSelected" />
<ToolbarSettings ShowToolbar="True" ToolbarItems="search"></ToolbarSettings>
</ej:Grid>
</DialogContent>
</ej:Dialog>
$("#btn").ejButton({
text: "...",
click: function (args) {
$("#Dialog").ejDialog("open");
}
})
function open(args) {
$("#PopupGrid").ejGrid({ allowPaging: true });
}
function rowSelected(args) {
$("#ContentPlaceHolder1_txtcustomer").val(args.data.CustomerName).text(args.data.CustomerName);
$("#Dialog").ejDialog("close");
}
function rowSelected(args) {
$("#ContentPlaceHolder1_txtcustomer").val(args.data.CustomerName).text(args.data.CustomerName);
var gridObj = $("#PopupGrid").data("ejGrid");
gridObj.clearSelection(args.rowIndex);
$("#Dialog").ejDialog("close");
} |
function rowSelected(args) {
if ($("#Dialog").data("ejDialog") ){
$("#Dialog").ejDialog("close");
}
} |
<Triggers>
<asp:AsyncPostBackTrigger ControlID="OrdersGrid" />
</Triggers>
[frmship.aspx]
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ej:Grid ID="OrdersGrid" ClientIDMode="Static" runat="server" AllowPaging="True" AllowFiltering="false" OnServerEditRow="EditEvents_ServerEditRow"
OnServerAddRow="EditEvents_ServerAddRow" OnServerDeleteRow="EditEvents_ServerDeleteRow">
...
<Triggers>
<asp:AsyncPostBackTrigger ControlID="OrdersGrid" />
</Triggers>
</asp:UpdatePanel>
<ej:Dialog ID="Dialog" ClientIDMode="Static" ClientSideOnBeforeOpen="open" ActionButtons="close,search" ShowOnInit="false" EnableModal="true" runat="server" Title="SearchGrid">
<DialogContent>
<ej:Grid ID="PopupGrid" runat="server" ClientIDMode="Static">
...
</ej:Grid>
</DialogContent>
</ej:Dialog>
[frmship.aspx.cs]
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack) BindcustomerSource(); //DataSource for PopupGrid
BindDataSource();
BindshipSource();
Session["DialogDataSource"] = order;
} |