Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
1.4K+ views
Hi,

I use telerik components and Ajax.Net. I have a strange error when I click on the grid : Sys.InvalidOperationException: A control is already associated with the element.

<

asp:Content ID="Content1" ContentPlaceHolderID="cl" runat="server">

<asp:UpdatePanel runat="server" ID="upd1"><ContentTemplate>
// RAD GRID used here, inside the FlashInfoGrid  component.
</ContentTemplate></asp:UpdatePanel>

</

asp:Content>

 <

asp:Content ID="Content2" ContentPlaceHolderID="cb" runat="server">

<

asp:UpdatePanel runat="server" ID="upd2"><ContentTemplate>
// Control to display when I click on the Edit button of the RadGridView.
</ContentTemplate></asp:UpdatePanel>

</

asp:Content>

Maybe, the UpdatePanel doesn't ork very well with the RadGrid of Telerik ? Or maybe, I don't use the UpdatePanel correctly ? Maybe I should use the RadAjaxManager of Telerik ?

Thank you in advance,

Rahul
Top achievements
Rank 1
 answered on 13 Oct 2015
1 answer
54 views

I am adding nodes in the NodeExpand event to utilize LOD.  However, the treeview uses a NodeTemplate which is added in the OnInit and Page_load events.  But I cannot access the controls for the new node that I'm adding.  Do I need to add the node to the treeview first and reiterate through it to access the control?

 I need to access the controls to set a control to visible for the newly created node and to modify the node text.

JNG
Top achievements
Rank 1
 answered on 12 Oct 2015
6 answers
101 views

Hi

i have the following issue, i have a very basic page with a rotator on it.

but PauseOnMouseOver doesnt seem to be working, it simply wont pause on mouse over.

 i am using the latest version of telerik

 fyi the cdn bits is because i use a local version of it, but again thats the latest version.

 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RotatorPage.aspx.cs" Inherits="EAP.popups.RotatorPage" %>
 
<!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>
    <link href="../site/css/Common.css" rel="stylesheet" type="text/css" />
    <link href="../site/css/Header.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function OnClientItemsRequestFailed(sender, eventArgs) {
            var errorMessage = eventArgs.get_errorMessage();
            eventArgs.set_cancelErrorAlert(true);
        }
    </script>
</head>
 
<body style="background-color:white !Important;">
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableEmbeddedjQuery="true">
            <CdnSettings TelerikCdn="Enabled" BaseSecureUrl="https://host/cdn/Scripts" BaseUrl="https://host/cdn/Scripts" />
        </telerik:RadScriptManager>
 
        <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" EnableStyleSheetCombine="False">
            <CdnSettings TelerikCdn="Enabled" BaseUrl="https://host/cdn/Skins" BaseSecureUrl="https://host/cdn/Skins" />
        </telerik:RadStyleSheetManager>
 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        </telerik:RadAjaxManager>
 
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Bootstrap">
        </telerik:RadAjaxLoadingPanel>
 
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1" EnablePageHeadUpdate="true">
            <div class="rotator-container">
                <telerik:RadRotator ID="headlinesRotator" runat="server" ScrollDirection="Left" Width="500"
                    WrapFrames="true" FrameDuration="1" PauseOnMouseOver="true"
                    ScrollDuration="8000" Height="15" ItemHeight="15" ItemWidth="250"
                    CssClass="rotator">
                    <WebServiceSettings Path="../Services/EclipseService.asmx" Method="GetRotatorData" />
                </telerik:RadRotator>
            </div>
        </telerik:RadAjaxPanel>
    </form>
</body>
</html>


 

Vessy
Telerik team
 answered on 12 Oct 2015
1 answer
94 views

 

<asp:Panel runat="server" ID="panelAddUser" class="panel panel-primary">
      <div class="panel-heading">New User</div>
      <div class="panel-body">
        <div class="row">
        <div class="col-xs-4">
            <asp:TextBox runat="server" ID="txtUsername" CssClass="form-control input-lg" placeholder="Username" MaxLength="32" required="required" ValidationGroup="FormValidate" />
        </div>
        <div class="col-xs-4">
            <asp:TextBox runat="server" ID="txtPassword" CssClass="form-control input-lg" placeholder="Password" TextMode="Password" MaxLength="32" required="required" ValidationGroup="FormValidate" />
        </div>
        <div class="col-xs-4">
            <asp:TextBox runat="server" ID="txtConfirmPassword" CssClass="form-control input-lg" placeholder="Confirm Password" TextMode="Password" MaxLength="32" required="required" ValidationGroup="FormValidate" />
        </div>
        </div><!-- /.row -->
</div>
</div>
</asp:Panel>

 I have this panel and then below it i have another panel containing RadGrid control :)

When i click e.g. Edit or Delete imagebuttons in the Grid, i get the HTML5 validation errors from the panel panelAddUser. 

I tried CauseValidation but it didn't help at all (i kept getting those errors). 

Thank you

 

 

 

Maria Ilieva
Telerik team
 answered on 12 Oct 2015
1 answer
91 views

I have a textbox and a search button and a RadGrid which was already bound data to by OnNeedDataSource event. When I click search button, it will get the new data and I Rebind() that data on search button click event. But when I change page number on the grid, the datasource was not the datasource I've already Rebind().

Please help, it's urgent.

Thanks and Best regards.

Maria Ilieva
Telerik team
 answered on 12 Oct 2015
1 answer
104 views

I have some asp text box in each of one i use a property call required like this 

1.<asp:TextBox runat="server" ID="TxtCorreoVal" CssClass="form-control" required>

and in the css i use this, i upload an image of how it looks in a normal textbox i want use the same functionality on RadDatePicker and RadComboBox

how can i do this

01.input:required:invalid, input:focus:invalid {
02.    background-image: url(../imagenes/required.png);
03.    background-position: right top;
04.    background-repeat: no-repeat;
05.    -moz-box-shadow: none;
06.  }
07.  input:required:valid {
08.    background-image: url(../imagenes/Ok.png);
09.    background-position: right top;
10.    background-repeat: no-repeat;
11.  }

 â€‹

 Thank for your time

 

Konstantin Dikov
Telerik team
 answered on 12 Oct 2015
8 answers
93 views

Hi

 

I am using GroupByHeaderFirstColumnSpan property in my Radgrid to group the columns.

I want to use static headers and frozen columns with the same but on adding this, grid is losing the data.

 

Please let me know if we can use static headers and frozen columns with GroupByHeaderFirstColumnSpan property set in Radgrid.

Maria Ilieva
Telerik team
 answered on 12 Oct 2015
8 answers
120 views

On a chart with the layout set to stock I have noticed an odd behavior. When using the navigator, the chart will update as expected, but the original series labels will be stuck in place and not disappear.

Any idea what may cause this or what setting needs to be changed? We have noticed this in 2 separate projects on 2 different development machines.

I have included 2 screen shots to show.

Danail Vasilev
Telerik team
 answered on 12 Oct 2015
6 answers
365 views
I have an autogenerated radgrid and detail table. I am resizeToFit() the columns in both the mastertableview, and the detailtable. (see javascript block). I am colorizing cell backcolors based upon the cell value.

 

When a user clicks a row, or clicks the expand/collapse image, the PartnerID is then stored in the Session Data, to retrieve the respective data from the db. The PartnerID's in the parent table, match those in the DetailTable.

 

Everything works as expected, however I am only able to expand one row when the page has finished loading. It does not matter which row it is. I can expand that row once, and then collapse that row once. After that I am unable to expand any other row in the parent table. Clicking on the other expand icons triggers a postback, but nothing is changed. I have tried expanding a row, and then attempting to expand a second row, but that does not work either.

 

I have verified that the datasource is retrieving new data based on the session variable. I have tried using the selected value for RadGrid1 on my datasource, and that works fine. But the behavior is the same.

 

The data to populate the parent table, looks like this. It comes from SqlDataSourcePartnerOverview

|PartnerID|PartnerName|num_patients|avg_answer|Q1|Q2|Q3|

|int|string|int|double|double|double|double|

 

The data to populate the detail table, looks like this. It comes from SqlDataSourcePartnerQuestionDetails

|PartnerID|QuestionNumber|Question|num_patients|num_responses|avg_answer|

|int|int|string|int|int|double|

 
 I have a second radgrid that is populated based on the Session["PartnerID"], but that works fine, so I haven't included it's source.
 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadGrid1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid2" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="RadGrid2">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid2"></telerik:AjaxUpdatedControl>
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Metro" Transparency="75" />
            <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
                <script type="text/javascript">
                    function gridCreated(sender, args) {
                        var columns = sender.get_masterTableView().get_columns();
                        for (var i = 0; i < columns.length; i++) {
                            columns[i].resizeToFit(false, true);
                        }
                    }
 
                    function detailCreated(sender, eventArgs) {
                        var detailTables = sender.get_detailTables();
                        //iterates over all detail tables in gridview
                        for (var i = 0; i < detailTables.length; i++) {
                            var detailColumns = detailTables[i].get_columns();
                            //iterates over each column in detail table
                            for (var j = 0; j < detailColumns.length; j++) {
                                detailColumns[j].resizeToFit(false, true);
                            }
                        }
 
                    }
                </script>
            </telerik:RadCodeBlock>
            <br />
            <br />
            <h3>Partner Overview:</h3>
            <div id="partnerGridDiv">
                <telerik:RadGrid
                    runat="server"
                    ID="RadGrid1"
                    Skin="Metro"
                    BorderStyle="Solid"
                    AllowSorting="True"
                    DataSourceID="SqlDataSourcePartnerOverview"
                    OnItemCommand="RadGrid_ItemCommand"
                    AutoGenerateColumns="true"
                    OnColumnCreated="RadGrid_ColumnCreated"
                    OnItemDataBound="RadGrid_ItemDataBound"
                    EnableHeaderContextMenu="true"
                    ShowFooter="true"
                    ViewStateMode="Enabled"
                    MasterTableView-HierarchyLoadMode="ServerOnDemand">
                    <ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="true">
                        <Selecting AllowRowSelect="true"></Selecting>
                        <Resizing ResizeGridOnColumnResize="true" AllowColumnResize="true" AllowResizeToFit="True" />
                        <Scrolling AllowScroll="false" UseStaticHeaders="false" />
                        <ClientEvents OnGridCreated="gridCreated" OnTableCreated="detailCreated"/>
                    </ClientSettings>
                    <HeaderStyle BackColor="#42608D" ForeColor="White" HorizontalAlign="Left" />
                    <ItemStyle HorizontalAlign="Left" />
                    <MasterTableView TableLayout="fixed" NoMasterRecordsText="No records found" DataKeyNames="PartnerID" DataSourceID="SqlDataSourcePartnerOverview">
                        <DetailTables>
                            <telerik:GridTableView Width="75%" AutoGenerateColumns="true" Name="PartnerDetailTable" runat="server" DataSourceID="SqlDataSourcePartnerQuestionDetails" DataKeyNames="PartnerID"  ShowFooter="true">
                                <ParentTableRelation>
                                    <telerik:GridRelationFields DetailKeyField="PartnerID" MasterKeyField="PartnerID" />
                                </ParentTableRelation>
                                <Columns>
                                    <%--<telerik:GridBoundColumn DataField="QuestionNumber" DataType="System.Int32" HeaderText="Question Number" SortExpression="QuestionNumber" UniqueName="QuestionNumber" HeaderStyle-Width="10%" />
                                    <telerik:GridBoundColumn DataField="Question" Aggregate="Count" HeaderText="Question" FooterStyle-HorizontalAlign="Left" SortExpression="PartnerName" UniqueName="PartnerName" />
                                    <telerik:GridBoundColumn DataField="num_patients" DataFormatString="{0:n0}" Aggregate="Sum" FooterAggregateFormatString="Total: {0:n0}" FooterStyle-HorizontalAlign="Left" HeaderStyle-Width="10%" DataType="System.Int32" HeaderText="# of Patients" ReadOnly="True" SortExpression="num_patients" UniqueName="num_patients" />
                                    <telerik:GridBoundColumn DataField="num_responses" DataFormatString="{0:n0}" Aggregate="Sum" FooterAggregateFormatString="Total: {0:n0}" FooterStyle-HorizontalAlign="Left" HeaderStyle-Width="10%" DataType="System.Int32" HeaderText="# of Responses" ReadOnly="True" SortExpression="num_responses" UniqueName="num_responses" />
                                    <telerik:GridBoundColumn DataField="avg_answer" DataFormatString="{0:P0}" DataType="System.Double" FilterControlAltText="Filter avg_answer column" HeaderText="Average Response" ReadOnly="True" SortExpression="avg_answer" UniqueName="avg_answer" />--%>
                                </Columns>
                            </telerik:GridTableView>
                        </DetailTables>
                    </MasterTableView>
                </telerik:RadGrid>
            </div>
 
<asp:SqlDataSource ID="SqlDataSourcePartnerOverview" runat="server" ConnectionString="<%$ ConnectionStrings:mdpSupportServices %>" SelectCommand="rpt_SurveyData_Partner_Overview" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:ControlParameter ControlID="RadDatePickerStartDate" PropertyName="SelectedDate" Name="startDate" Type="DateTime"></asp:ControlParameter>
                <asp:ControlParameter ControlID="RadDatePickerEndDate" PropertyName="SelectedDate" Name="endDate" Type="DateTime"></asp:ControlParameter>
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSourcePartnerQuestionDetails" runat="server" ConnectionString="<%$ ConnectionStrings:mdpSupportServices %>" SelectCommand="rpt_SurveyData_Partner_Question_Details" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:SessionParameter Name="PartnerID" SessionField="PartnerID" Type="Int64" />
                <asp:ControlParameter ControlID="RadDatePickerStartDate" Name="StartDate" PropertyName="SelectedDate" Type="DateTime" />
                <asp:ControlParameter ControlID="RadDatePickerEndDate" Name="EndDate" PropertyName="SelectedDate" Type="DateTime" />
            </SelectParameters>
        </asp:SqlDataSource>

 

 

 here is my code behind

 

protected void Page_Load(object sender, EventArgs e)
    {
        mdpBaseComponent.PageTitle = "Solution Reach Survey Report";
        mdpBaseComponent.PageSubTitle = "mdpSupportServices/SolutionReach_SurveyReport";
        if (!IsPostBack)
        {
            this.RadDatePickerStartDate.SelectedDate = DateTime.Now.AddMonths(-1);
            this.RadDatePickerEndDate.SelectedDate = DateTime.Now;
            Session.Clear();
        }
        else
        {
            //postback!!!
        }
         
    }

protected void RadGrid_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = (GridDataItem)e.Item;
            if (item.OwnerGridID == "RadGrid1")
            {
                Session["PartnerID"] = item["PartnerID"].Text;
            }
            if (e.CommandName == "RowClick")
            {
                 //do nothing
            }
            else if (e.CommandName == Telerik.Web.UI.RadGrid.ExpandCollapseCommandName)
            {
                item.Selected = true;
            }
             
        }
    }
     
    protected void RadGrid_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
    {
        if (e.Column is GridBoundColumn)
        {
            GridBoundColumn gbc = ((GridBoundColumn)e.Column);
            int n;
            if (gbc.HeaderText == "Partner ID")
            {
                gbc.Display = false;
            }
            else if (gbc.HeaderText == "Venue ID")
            {
                gbc.Display = false;
            }
            else if (gbc.HeaderText == "Partner Name")
            {
                gbc.HeaderText = "Partner";
            }
            else if (gbc.HeaderText == "Venue Name")
            {
                gbc.HeaderText = "Venue";
 
            }
            else if (gbc.HeaderText == "num_patients")
            {
                gbc.HeaderText = "Patients";
                gbc.DataFormatString = "{0:n0}";
                gbc.FooterStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Left;
                gbc.FooterAggregateFormatString = "{0:n0}";
                gbc.FooterStyle.Wrap = false;
                gbc.Aggregate = Telerik.Web.UI.GridAggregateFunction.Sum;
            }
            else if (gbc.HeaderText == "num_responses")
            {
                gbc.HeaderText = "Responses";
                gbc.DataFormatString = "{0:n0}";
                gbc.FooterStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Left;
                gbc.FooterAggregateFormatString = "{0:n0}";
                gbc.FooterStyle.Wrap = false;
                gbc.Aggregate = Telerik.Web.UI.GridAggregateFunction.Sum;
            }
            else if (gbc.HeaderText == "avg_answer")
            {
                gbc.HeaderText = "Avg";
                gbc.FooterStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Left;
                gbc.DataType = typeof(double);
                gbc.DataFormatString = "{0:P1}";
                gbc.FooterAggregateFormatString = "{0:P1}";
                gbc.FooterStyle.Wrap = false;
                gbc.Aggregate = Telerik.Web.UI.GridAggregateFunction.Avg;
            }
            else if (gbc.HeaderText[0] == 'Q' && int.TryParse(gbc.HeaderText.Substring(1,gbc.HeaderText.Length-1), out n))
            {
                //if first letter is Q, and rest of string is integer
                // Q1,Q2,Q3 etc...
                gbc.FooterStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Left;
                gbc.DataType = typeof(double);
                gbc.DataFormatString = "{0:P1}";
                gbc.FooterAggregateFormatString = "{0:P1}";
                gbc.FooterStyle.Wrap = false;
                gbc.Aggregate = Telerik.Web.UI.GridAggregateFunction.Avg;
            }
        }
    }
 
     
      //colorize cells based on value
    public Color cellColor(double val, Color currentColor)
    {
        Color red = ColorTranslator.FromHtml("#F26C72");
        Color green = ColorTranslator.FromHtml("#64C23E");
        Color yellow = ColorTranslator.FromHtml("#DFCA3F");
        Color lightGreen = ColorTranslator.FromHtml("#BEFFBE");
        if (val >= .85)
            return currentColor;
        else if (val >= .70)
            return yellow;
        else
            return red;
    }
 
    protected void RadGrid_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = (GridDataItem)e.Item;
            foreach (GridColumn col in item.OwnerTableView.AutoGeneratedColumns)
            {
                if (col.DataType == typeof(double))
                {
                    double value;
                    if (double.TryParse(DataBinder.Eval(item.DataItem, col.UniqueName).ToString(), out value))
                    {
                        item[col.UniqueName].BackColor = cellColor(value, item[col.UniqueName].BackColor);
                    }
                }
            }
        }
    }

Eyup
Telerik team
 answered on 12 Oct 2015
1 answer
177 views

I am having trouble passing selected rows from one grid to another. My currently implementation seems to work in Chrome but not IE. 

Currently I have 3 databound columns and 4 template columns that are static in my grid and I need to pass information that is entered into those fields to my second grid. I am currently doing this by using ajax.

 I loop through the selected rows then get the values from each column and pass the values as a string using ajaxrequest(string). As I said before this seems to work in Chrome but not IE. In IE it only seems to pass in the last row selected to the code behind, So when it binds to the second grid  it will only populate information from the last row selected. Javascript doesn't seem to tun the same in both browsers. 

Also if there is a better way then  using static columns and ajax I would love to hear it .

Here is some code.

Javascript:

function InitiateAjaxRequest(arguments) {
                   var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
                   ajaxManager.ajaxRequest(arguments);
       }

 function addSelectedRows() {
            debugger;
            //SysSet('Action', <%= Actions.LoadOrder%>);
            var grid = $find("<%= rgPOLines.ClientID %>"); 
            if (grid) { 
                var MasterTable = grid.get_masterTableView(); 
                var Rows = MasterTable.get_dataItems(); 
                var selectedRows = MasterTable.get_selectedItems();
                if (selectedRows.length > 0) {
                    for (var i = 0; i < selectedRows.length; i++) { 
                        var selectedrow = selectedRows[i];                  
                        var getContainer_cnt = selectedrow.get_cell("Container_cnt"),
                            getQty_toreceive = selectedrow.get_cell("Qty_toreceive"),
                            getMfgLotNo = selectedrow.get_cell("MfgLotNo"),
                            getBin_no = selectedrow.get_cell("Bin_no");
                        //var test = $telerik.$(getQty_toreceive).find('input')[0].value;
                        //var test2 = test.replace(/,/g, "");
 
                        // Row text data
                        var Line_no = selectedrow.get_cell("Line_no").innerText,
                            Item_no = selectedrow.get_cell("Item_no").innerText,
                            Qty_remaining = selectedrow.get_cell("Qty_remaining").innerText,
                            Container_cnt = $telerik.$(getContainer_cnt).find('input')[0].value,
                            Qty_toreceive = convertToFloat($telerik.$(getQty_toreceive).find('input')[0].value) / Container_cnt,
                            Total_Qty_toreceive = $telerik.$(getQty_toreceive).find('input')[0].value,
                            MfgLotNo = $telerik.$(getMfgLotNo).find('input')[0].value,
                            Lot_no = "",
                            Bin_no = $telerik.$(getBin_no).find('span')[0].innerText;
                         
                        if (Container_cnt && Total_Qty_toreceive && MfgLotNo && (Bin_no != "Select Bin" || Bin_no)) {
                            var rowData = Line_no + "," + Item_no + "," + Qty_remaining + "," + Container_cnt + "," + Qty_toreceive + "," + Total_Qty_toreceive + "," + MfgLotNo + "," + Lot_no + "," + Bin_no
 
                            InitiateAjaxRequest(rowData); 
                            //SysSubmit(1);
                             
                        } else {
                            alert("Data must be entered in NUMBER OF CONTAINERS, QTY TO RECEIVE, and MFG LOT #.")                                                      
                        }
 
                        // Method1 
                        //var getCellText_1 = row.get_element().cells[0].innerHTML; 
                        // Method2 
                     
                        // Method3 
                        //var getCellText_2 = row.get_cell("Name").getElementsByTagName("span")[0].innerHTML; //this code also work for Checkboxcolunm, hyperlinkcolumn...etc 
                    }
                     
                } else {
                    alert("At least one row must be selected.")
                
                 
                 
            }   
             
        }

VB:

Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As AjaxRequestEventArgs)
        ' Remove all carriage returns from data
        Dim argument = e.Argument.Replace(vbCr, "").Replace(vbLf, "")
        ' Add data to array
 
        Dim orderNo = LTrim(RTrim(Ord_no.Value))
        Dim location = LTrim(RTrim(lblShip_to_cd.InnerText))
        Dim rowData() = argument.Split(",".ToCharArray())
        rowData = (orderNo & "," & String.Join(",", rowData) & "," & location).Split(",".ToCharArray)
 
        ' Add data to DataTable
        GetData(rowData)
 
        ' Add data to secondary grid
        BindSecondaryGrid()
    End Sub

ASPX:

<telerik:RadGrid ID="rgPOLines" runat="server" AllowPaging="false" CellSpacing="0" ShowFooter="false" GridLines="None"
                            AllowMultiRowSelection="true" OnPreRender="rgPOLines_PreRender" OnItemDataBound="rgPOLines_ItemDataBound">
 
                            <MasterTableView CommandItemDisplay="TopAndBottom" EditMode="Batch" AutoGenerateColumns="false"
                                RetrieveNullAsDBNull="true" DataKeyNames="Line_no">
 
                                <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false"
                                    ShowSaveChangesButton="false" ShowExportToExcelButton="false" ShowExportToCsvButton="false" />
                                <Columns>                                 
 
                                    <telerik:GridClientSelectColumn HeaderText="Select For Receipt" UniqueName="Item_selected"></telerik:GridClientSelectColumn>
 
                                    <telerik:GridBoundColumn DataField="Line_no" HeaderText="Line_no" UniqueName="Line_no" ReadOnly="true">
                                    </telerik:GridBoundColumn>
 
                                    <telerik:GridBoundColumn DataField="Item_no" HeaderText="Item_no" UniqueName="Item_no" ReadOnly="true">
                                    </telerik:GridBoundColumn>
 
                                    <telerik:GridNumericColumn DataField="Qty_remaining" HeaderText="Qty Remaining" DecimalDigits="0" UniqueName="Qty_remaining" ReadOnly="true">
                                    </telerik:GridNumericColumn>
                                     
                                    <telerik:GridTemplateColumn HeaderText="Number of Containers" UniqueName="Container_cnt" DataField="Container_cnt">   
                                        <ItemTemplate>
                                            <telerik:RadNumericTextBox ID="ContainerCnt" runat="server" MinValue="0" MaxValue="999999999"><NumberFormat GroupSeparator="" DecimalDigits="0" /></telerik:RadNumericTextBox>
                                        </ItemTemplate>                                  
                                    </telerik:GridTemplateColumn>
 
                                    <telerik:GridTemplateColumn HeaderText="Qty to Receive" UniqueName="Qty_toreceive" DataField="Qty_toreceive">   
                                        <ItemTemplate>
                                            <telerik:RadNumericTextBox ID="Qty_toreceive" runat="server" Type="Number"></telerik:RadNumericTextBox>
                                        </ItemTemplate>                                  
                                    </telerik:GridTemplateColumn>
 
                                    <telerik:GridTemplateColumn HeaderText="Mfg Lot #" UniqueName="MfgLotNo" DataField="MfgLotNo">   
                                        <ItemTemplate>
                                            <telerik:RadTextBox ID="MfgLotNo" runat="server" MaxLength="15"></telerik:RadTextBox>                                           
                                        </ItemTemplate>            
                                    </telerik:GridTemplateColumn>                                    
 
                                    <telerik:GridTemplateColumn HeaderText="Bin #" UniqueName="Bin_no">
                                        <ItemTemplate>                                           
                                             
                                            <telerik:RadDropDownList runat="server" ID="Bin_no" AutoPostBack="false" DataTextField="Bin" DataValueField="Bin">
                                            </telerik:RadDropDownList>                                                                 
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                </Columns>
                            </MasterTableView>
 
                            <ClientSettings AllowKeyboardNavigation="false" AllowColumnsReorder="false" Selecting-AllowRowSelect="true">
                                 
                            </ClientSettings>
                        </telerik:RadGrid
<telerik:RadButton ID="btnAddSelectedRows" runat="server" Text="Add Selected Rows To Receipt" OnClientClicked="addSelectedRows"
                            ToolTip="Add Selected Rows" AutoPostBack="false">
                        </telerik:RadButton>
 
<telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1"></telerik:RadAjaxLoadingPanel>
        <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
        <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" Skin="Silk" />
 
        <telerik:RadAjaxManager ID="RadAjaxManager1" EnableAJAX="true" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rgPOLines" />
                        <telerik:AjaxUpdatedControl ControlID="rgMfgLot" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="rgMfgLot">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rgMfgLot" />
                    </UpdatedControls>
                </telerik:AjaxSetting>                            
            </AjaxSettings>
       </telerik:RadAjaxManager>
 
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecorationZoneID="demo"
            DecoratedControls="All" EnableRoundedCorners="false" />

Konstantin Dikov
Telerik team
 answered on 12 Oct 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?