- Home
- Forum
- ASP.NET Web Forms
- Dialog box - add/edit records in grid
Dialog box - add/edit records in grid
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");
}
Thanks
Pratheep
Attachment: WebApplication1_cc36928f.rar
|
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");
}
} |
Thank you for your support.Working fine but another issue
After add/edit /delete OrdersGrid records
if apply Triggers
<Triggers>
<asp:AsyncPostBackTrigger ControlID="OrdersGrid" />
</Triggers>
if not apply Triggers working fine but every time page is refreshing.
Thanks
Pratheep
Attachment: WebApplication1_589fb2d7.rar
|
[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;
} |
Thank you for your support.Working fine.
Thanks
Pratheep
- 5 Replies
- 2 Participants
-
PR Pratheep
- Nov 20, 2016 06:53 PM UTC
- Nov 25, 2016 03:43 AM UTC