This is a migrated thread and some comments may be shown as answers.

displaying an intermediate selection dialog

3 Answers 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
CP
Top achievements
Rank 1
Iron
CP asked on 28 Sep 2016, 11:51 AM

I want to be able to intercept the insert action for a RadGrid and display a window allowing the user to select criteria which will then be carried over into the true editing control to pre-populate some of the data. I know that I can pre-populate controls in the ItemCommand event with hard-coded values by checking for InitInsertCommandName and locating the controls to populate.

Can I at this point open a radwindow containing the below and page. This window will allow the user to select from the 2 dropdowns & the textbox and on clicking the 'Select' button populate the grid with matching data from a database. On double clicking a row of data, that data will be sent back to the ItemCommand to populate the edit control.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ItemSelection.aspx.cs" Inherits="MaxOrdersTab.Dialogs.ItemSelection" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="gridLoadingPanel"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="gridLoadingPanel"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
         
        <div>
 
 
 
            <asp:Label ID="Label1" runat="server" AssociatedControlID="ddlProviders">Product Provider:   </asp:Label>
 
            <telerik:RadDropDownList ID="ddlProviders" runat="server" Width="200px" CssClass="DropDown_Providers">
            </telerik:RadDropDownList>
 
            <asp:Label ID="Label2" runat="server" AssociatedControlID="ddlGroups">  Product Group:   </asp:Label>
 
            <telerik:RadDropDownList ID="ddlGroups" runat="server">
            </telerik:RadDropDownList>
 
            <asp:Label ID="Label3" runat="server" AssociatedControlID="tbxDescription">  Product Description:   </asp:Label>
 
            <telerik:RadTextBox ID="tbxDescription" runat="server">
            </telerik:RadTextBox>
             
               
 
            <telerik:RadButton ID="RadButton1" runat="server" Text="Select"
                onclick="RadButton1_Click">
            </telerik:RadButton>
             
            <br />
            <br />
 
 
            <telerik:RadAjaxLoadingPanel ID="gridLoadingPanel" runat="server" Skin="Default" Width="100%">
 
                <telerik:RadGrid ID="RadGrid1" runat="server"
                    OnItemCreated="RadGrid1_ItemCreated"
                    AllowPaging="True" Width="99%" AutoGenerateColumns="False"
                    IsExporting="False" PageSize="15"
                    ShowHeader="False" GroupPanelPosition="Top">
 
                    <MasterTableView ClientDataKeyNames="SelectionID"
                        Width="100%" CommandItemDisplay="None" PageSize="5">
                        <Columns>
                            <telerik:GridBoundColumn DataField="Product_Provider"
                                HeaderText="Product Provider" ReadOnly="true"
                                SortExpression="Product_Provider" UniqueName="Product_Provider"
                                AllowSorting="False" Exportable="False" Groupable="False" Reorderable="False"
                                Resizable="False" ShowSortIcon="False"
                                FilterControlAltText="Filter Product_Provider column">
                                <HeaderStyle Font-Bold="True" />
                                <ItemStyle Width="20%" Wrap="False" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Product_Group" HeaderText="Product Group" ReadOnly="true"
                                SortExpression="Product_Group" UniqueName="Product_Group"
                                AllowFiltering="False" AllowSorting="False" Groupable="False"
                                Reorderable="False" Resizable="False" ShowSortIcon="False"
                                FilterControlAltText="Filter Product_Group column">
                                <HeaderStyle Font-Bold="True" />
                                <ItemStyle Width="20%" Wrap="False" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Product_Code" HeaderText="Product Code" ReadOnly="True"
                                SortExpression="Product_Code" UniqueName="Product_Code"
                                AllowFiltering="False" AllowSorting="False" Groupable="False"
                                Reorderable="False" Resizable="False" ShowSortIcon="False"
                                FilterControlAltText="Filter Product_Code column">
                                <HeaderStyle Font-Bold="True" />
                                <ItemStyle Width="20%" Wrap="False" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Product_Description"
                                HeaderText="Product Description" ReadOnly="true"
                                SortExpression="Product_Description" UniqueName="Product_Description"
                                AllowFiltering="False" AllowSorting="False" Groupable="False"
                                Reorderable="False" Resizable="False" ShowSortIcon="False">
                                <HeaderStyle Font-Bold="True" />
                                <ItemStyle Width="40%" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Unit_Sell"
                                HeaderText="Unit Sell" SortExpression="Unit_Sell" UniqueName="Unit_Sell"
                                AllowFiltering="False" AllowSorting="False" Groupable="False"
                                Reorderable="False" Resizable="False" ShowSortIcon="False" Visible="False">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Unit_Cost"
                                HeaderText="Unit Cost" SortExpression="Unit_Cost" UniqueName="Unit_Cost"
                                AllowFiltering="False" AllowSorting="False" Groupable="False"
                                Reorderable="False" Resizable="False" ShowSortIcon="False" Visible="False">
                            </telerik:GridBoundColumn>
                        </Columns>
 
                    </MasterTableView>
 
                    <GroupingSettings CollapseAllTooltip="Collapse all groups"
                        MainTableCaption="Line Item Selection" />
 
                    <ExportSettings>
                        <Pdf AllowPrinting="False">
                        </Pdf>
                        <Csv EncloseDataWithQuotes="False" />
                    </ExportSettings>
 
                    <ValidationSettings EnableModelValidation="False" EnableValidation="False" />
 
                    <ClientSettings>
                        <Selecting AllowRowSelect="true"></Selecting>
                        <ClientEvents OnRowDblClick="RadGrid1_RowDblClick"></ClientEvents>
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                    </ClientSettings>
 
                </telerik:RadGrid>
 
            </telerik:RadAjaxLoadingPanel>
     
    </div>
    </form>
</body>
</html>

 

        protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            GridEditableItem insertedItem;
            String MyUserControlId;
            UserControl MyUserControl;
 
            switch (e.CommandName)
            {
                case RadGrid.InitInsertCommandName:
                    e.Canceled = true;
 
 
 
// display the RadWindow here to request the data to pre-populate the edit control.
 
 
 
                    e.Item.OwnerTableView.InsertItem();
 
                    insertedItem = e.Item.OwnerTableView.GetInsertItem();
                    MyUserControlId = GridEditFormItem.EditFormUserControlID;
                    MyUserControl = insertedItem.FindControl(MyUserControlId) as UserControl;
 
                    RadNumericTextBox box;
                    box = MyUserControl.FindControl("ntbUnitCost") as RadNumericTextBox;
                    box.Value = // Value1 returned from selection dialog
                    box = MyUserControl.FindControl("ntbUnitSell") as RadNumericTextBox;
                    box.Value = // Value2 returned from selection dialog
 
                    box = MyUserControl.FindControl("ntbQty") as RadNumericTextBox;
                    box.Focus();
                    break;
                default:
                    break;
            }
        }

3 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 03 Oct 2016, 07:12 AM
Hello Robbie,

This is a highly custom requirement and there is no straight forward solution that we can provide, but you can go through the following help articles, which should help you achieving the desired result:
I should mention that you will have to use a custom button or external button for initiating your custom insert that will open the popup and not the built-in "Add new record" button of the RadGrid. Once you handle the double click event of the grid in the popup you could initiate a custom command through the main grid and use the following code to manually initiate the insert with the values:
Dictionary<string, string> initValues = new Dictionary<string, string>();
//fill the initValues
RadGrid1.MasterTableView.InsertItem(initValues);

Hope this helps.


Regards,
Konstantin Dikov
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
CP
Top achievements
Rank 1
Iron
answered on 06 Oct 2016, 02:18 PM

Hi Konstantin,

I stared looking at this and created a small test app where i removed the in-grin insert new row option and created an external button to pop my selection window. The window seems to pop-up but immediately disappears. I've placed breakpoints in the selection page but nothing is hit so i'm not sure where its going astray ?

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ProductSearchTest.Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
 
    <telerik:RadAjaxManager runat="server" ID="radAjax" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        <Windows>
            <telerik:RadWindow RenderMode="Lightweight" ID="RadWindow2" runat="server" Modal="true" NavigateUrl="../ItemSelection.aspx" Width="750px" Height="500px" Style="z-index: 100001;">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
 
    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script type="text/javascript">
            function execOpenSearch() {
//                var oWnd = $find("<%=RadWindow1.ClientID%>");
//                oWnd.setUrl('ItemSelection.aspx');
//                oWnd.show();
 
                //Call existing global function to obtain a reference to the window manager
                var oManager = GetRadWindowManager();
 
                //Show a particular existing window
                oManager.open(null, "RadWindow2");
            }
 
            function setCustomPosition(sender, args) {
                sender.moveTo(sender.getWindowBounds().x, 280);
            }
 
            function onRowDropping(sender, args) {
                if (sender.get_id() == "RadGrid1") {
                    var node = args.get_destinationHtmlElement();
                    if ( !isChildOf('<%=RadGrid1.ClientID %>', node) ) {
                        args.set_cancel(true);
                    }
                }
            }
            function isChildOf(parentId, element) {
                while (element) {
                    if (element.id && element.id.indexOf(parentId) > -1) {
                        return true;
                    }
                    element = element.parentNode;
                }
                return false;
            }
 
            function RowDblClick(sender, eventArgs) {
                sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
            }
 
            function onPopUpShowing(sender, args) {
                args.get_popUp().className += " popUpEditForm";
            }
        </script>
 
        <script src="EditValidation.js" type="text/javascript"></script>
 
    </telerik:RadScriptBlock>
 
 
    <div>
 
        <telerik:RadGrid ID="RadGrid1" runat="server" Width="850px"
                            AllowPaging="True" AllowSorting="True"
                            OnItemCommand="RadGrid1_ItemCommand"
                            OnNeedDataSource="RadGrid1_NeedDataSource"
                            AutoGenerateColumns="False" GroupPanelPosition="Top"
                            OnRowDrop="RadGrid1_RowDrop" AllowMultiRowSelection="false"
                            Skin="Metro">
 
            <AlternatingItemStyle BorderStyle="None" />
 
            <ClientSettings AllowRowsDragDrop="true">
                <Selecting AllowRowSelect="true" />
            </ClientSettings>
 
            <MasterTableView width="100%" EditMode="PopUp" DataKeyNames="LineItem_Id,Row" CommandItemDisplay="Top">
 
                <EditFormSettings EditFormType="WebUserControl" CaptionFormatString="Line Item Edit"
                                    UserControlName="LineItemEditControl.ascx">
                    <EditColumn UniqueName="EditCommandColumn">
                    </EditColumn>
                    <PopUpSettings Modal="True" ZIndex="100010" Width="750px" Height="350px" ShowCaptionInEditForm="true" />
                    <FormCaptionStyle Font-Bold="true" BackColor="Chartreuse" HorizontalAlign="Center" />
                </EditFormSettings>
 
                <NoRecordsTemplate>
                    <div>
                        There are no records to display.......
                    </div>
                </NoRecordsTemplate>
 
                <CommandItemSettings ShowAddNewRecordButton="False" />
 
                <Columns>
                    <telerik:GridDragDropColumn>
                        <HeaderStyle Width="18px" />
                    </telerik:GridDragDropColumn>
 
                    <telerik:GridBoundColumn DataField="Row" HeaderText="Row"
                                                ItemStyle-HorizontalAlign="Right"
                                                SortExpression="Row" UniqueName="Row">
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Product_Group" HeaderText="Product Group"
                                                SortExpression="ProductGroup" UniqueName="ProductGroup">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Product_Group_Type" HeaderText="Group Type"
                                                SortExpression="ProductGroupType" UniqueName="ProductGroupType"
                                                Display="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Product_Provider" HeaderText="Product Provider"
                                                SortExpression="ProductProvider" UniqueName="ProductProvider">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Product_Code"
                                                HeaderText="Product Code" SortExpression="ProductCode"
                                                UniqueName="ProductCode">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Product_Description"
                                                HeaderText="Product Description" SortExpression="ProductDescription"
                                                UniqueName="ProductDescription">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Qty" HeaderText="Qty" DataType="System.Decimal"
                                                SortExpression="Qty" UniqueName="Qty">
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Qty_SA" HeaderText="Qty (SA)"
                                                SortExpression="QtySA" UniqueName="QtySA">
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Days" HeaderText="Days" DataType="System.Decimal"
                                                SortExpression="Days" UniqueName="Days" Display="false">
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridNumericColumn DataField="Days_Cost" HeaderText="Days (Cost)"
                                                SortExpression="DaysCost" UniqueName="DaysCost" Display="false">
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridNumericColumn>
                    <telerik:GridBoundColumn DataField="Amount"
                                                HeaderText="Amount" DataFormatString="{0:c2}" SortExpression="Amount" UniqueName="Amount">
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Cost" HeaderText="Cost" DataFormatString="{0:c2}" SortExpression="Cost" UniqueName="Cost">
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Unit_Sell" HeaderText="Unit Sell"
                                                SortExpression="UnitSell" DataFormatString="{0:c2}" UniqueName="UnitSell" Display="False">
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Unit_Cost" HeaderText="Unit Cost"
                                                SortExpression="UnitCost" DataFormatString="{0:c2}" UniqueName="UnitCost" Display="False">
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Prorata_Months" HeaderText="Pro-rata Months"
                                                SortExpression="ProrataMonths" UniqueName="ProrataMonths" Display="False">
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
 
<%--                                        <telerik:GridBoundColumn DataField="QtyDays" HeaderText="Qty/Days"
                                                ItemStyle-HorizontalAlign="Right" SortExpression="QtyDays"
                                                UniqueName="QtyDays" Display="False">
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="QtyDaysCost" HeaderText="Qty/Days Cost"
                                                ItemStyle-HorizontalAlign="Right" SortExpression="QtyDaysCost"
                                                UniqueName="QtyDaysCost" Display="False">
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>--%>
 
                    <telerik:GridBoundColumn DataField="Comments" HeaderText="Comments"
                                                SortExpression="Comments" UniqueName="Comments" Display="false">
                    </telerik:GridBoundColumn>
 
                    <telerik:GridEditCommandColumn ButtonType="ImageButton"
                                                    UniqueName="EditCommandColumn">
                    </telerik:GridEditCommandColumn>
                    <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete"
                                                Text="Delete" />
                </Columns>
 
                <PagerStyle Mode="NextPrev" PageSizeControlType="None" />
 
            </MasterTableView>
 
            <ExportSettings>
                <Pdf PageHeight="297mm" PageWidth="210mm" PaperSize="A4">
                </Pdf>
            </ExportSettings>
 
            <ClientSettings AllowRowsDragDrop="true">
                <Selecting AllowRowSelect="true" />
                <ClientEvents OnPopUpShowing="onPopUpShowing" OnRowDblClick="RowDblClick" />
            </ClientSettings>
 
            <HeaderStyle BackColor="#58A8CD" BorderStyle="None" ForeColor="White" />
            <ActiveItemStyle BorderStyle="None" />
            <ItemStyle BorderStyle="None" />
            <PagerStyle Mode="NextPrev" />
 
        </telerik:RadGrid>
 
 
        <div style="padding-top:20px; padding-right:30px;">
            <div style="margin-left: 20px;">
 
                <telerik:RadButton ID="cmdExecScript" runat="server" Text="Ad a new Item" CssClass="rounded"
                                    ButtonType="SkinnedButton" Width="120px"
                                    OnClientClicking="execOpenSearch">
                </telerik:RadButton>
 
            </div>
        </div>
 
 
        <telerik:RadWindow ID="RadWindow1" runat="server" Width="360px" Height="365px" Modal="true" OffsetElementID="main" OnClientShow="setCustomPosition" Style="z-index: 100001;">
        </telerik:RadWindow>
 
 
    </div>
    </form>
</body>
</html>

The selection page :

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ItemSelection.aspx.cs" Inherits="ProductSearchTest.ItemSelection" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="gridLoadingPanel"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="gridLoadingPanel"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
         
        <div>
 
            <asp:Label ID="Label1" runat="server" AssociatedControlID="ddlProviders">Product Provider:   </asp:Label>
 
            <telerik:RadDropDownList ID="ddlProviders" runat="server" Width="200px" CssClass="DropDown_Providers">
            </telerik:RadDropDownList>
 
            <asp:Label ID="Label2" runat="server" AssociatedControlID="ddlGroups">  Product Group:   </asp:Label>
 
<%--            <telerik:RadDropDownList ID="ddlGroups" runat="server">
            </telerik:RadDropDownList>--%>
            <telerik:RadComboBox ID="ddlGroups" runat="server" EmptyMessage="Enter or select a group...">
            </telerik:RadComboBox>
 
            <asp:Label ID="Label3" runat="server" AssociatedControlID="tbxDescription">  Product Description:   </asp:Label>
 
            <telerik:RadTextBox ID="tbxDescription" runat="server" EmptyMessage="Enter your search text...">
            </telerik:RadTextBox>
             
               
 
            <telerik:RadButton ID="RadButton1" runat="server" Text="Select"
                onclick="RadButton1_Click">
            </telerik:RadButton>
             
            <br />
            <br />
 
 
            <telerik:RadAjaxLoadingPanel ID="gridLoadingPanel" runat="server" Skin="Default" Width="100%">
 
                <telerik:RadGrid ID="RadGrid1" runat="server"
                    AllowPaging="True" Width="99%" AutoGenerateColumns="False" PageSize="15"
                    ShowHeader="False" GroupPanelPosition="Top">
 
                    <MasterTableView ClientDataKeyNames="SelectionID"
                        Width="100%" CommandItemDisplay="None" PageSize="5">
                        <Columns>
                            <telerik:GridBoundColumn DataField="Product_Provider"
                                HeaderText="Product Provider" ReadOnly="true"
                                SortExpression="Product_Provider" UniqueName="Product_Provider"
                                AllowSorting="False" Exportable="False" Groupable="False" Reorderable="False"
                                Resizable="False" ShowSortIcon="False"
                                FilterControlAltText="Filter Product_Provider column">
                                <HeaderStyle Font-Bold="True" />
                                <ItemStyle Width="20%" Wrap="False" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Product_Group" HeaderText="Product Group" ReadOnly="true"
                                SortExpression="Product_Group" UniqueName="Product_Group"
                                AllowFiltering="False" AllowSorting="False" Groupable="False"
                                Reorderable="False" Resizable="False" ShowSortIcon="False"
                                FilterControlAltText="Filter Product_Group column">
                                <HeaderStyle Font-Bold="True" />
                                <ItemStyle Width="20%" Wrap="False" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Product_Code" HeaderText="Product Code" ReadOnly="True"
                                SortExpression="Product_Code" UniqueName="Product_Code"
                                AllowFiltering="False" AllowSorting="False" Groupable="False"
                                Reorderable="False" Resizable="False" ShowSortIcon="False"
                                FilterControlAltText="Filter Product_Code column">
                                <HeaderStyle Font-Bold="True" />
                                <ItemStyle Width="20%" Wrap="False" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Product_Description"
                                HeaderText="Product Description" ReadOnly="true"
                                SortExpression="Product_Description" UniqueName="Product_Description"
                                AllowFiltering="False" AllowSorting="False" Groupable="False"
                                Reorderable="False" Resizable="False" ShowSortIcon="False">
                                <HeaderStyle Font-Bold="True" />
                                <ItemStyle Width="40%" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Unit_Sell"
                                HeaderText="Unit Sell" SortExpression="Unit_Sell" UniqueName="Unit_Sell"
                                AllowFiltering="False" AllowSorting="False" Groupable="False"
                                Reorderable="False" Resizable="False" ShowSortIcon="False" Visible="False">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Unit_Cost"
                                HeaderText="Unit Cost" SortExpression="Unit_Cost" UniqueName="Unit_Cost"
                                AllowFiltering="False" AllowSorting="False" Groupable="False"
                                Reorderable="False" Resizable="False" ShowSortIcon="False" Visible="False">
                            </telerik:GridBoundColumn>
                        </Columns>
 
                    </MasterTableView>
 
                    <GroupingSettings CollapseAllTooltip="Collapse all groups"
                        MainTableCaption="Line Item Selection" />
 
                    <ExportSettings>
                        <Pdf AllowPrinting="False">
                        </Pdf>
                        <Csv EncloseDataWithQuotes="False" />
                    </ExportSettings>
 
                    <ValidationSettings EnableModelValidation="False" EnableValidation="False" />
 
                    <ClientSettings>
                        <Selecting AllowRowSelect="true"></Selecting>
                        <ClientEvents OnRowDblClick="RadGrid1_RowDblClick"></ClientEvents>
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                    </ClientSettings>
 
                </telerik:RadGrid>
 
            </telerik:RadAjaxLoadingPanel>
     
    </div>
    </form>
</body>
</html>

0
Konstantin Dikov
Telerik team
answered on 07 Oct 2016, 04:33 AM
Hello,

Since the RadWindow will be opened on client-side, the RadButton that you are using for opening it must not initiate a postback. With that in mind, please set the AutoPostBack property to "false".


Best Regards,
Konstantin Dikov
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
CP
Top achievements
Rank 1
Iron
Answers by
Konstantin Dikov
Telerik team
CP
Top achievements
Rank 1
Iron
Share this question
or