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

Xmlhttppanel problem

1 Answer 32 Views
AJAX and Web 2.0
This is a migrated thread and some comments may be shown as answers.
Dayana Maliyakal
Top achievements
Rank 1
Dayana Maliyakal asked on 23 Sep 2011, 01:11 PM
Hi Telerik team,

    In radgrid rowselected event is not working if it in xmlhttppanel. How can I solve the issue?

My source code is below:

<

 

div>

 

 

<script type="text/javascript" language="javascript">

 

 

function OnClientClick() {

 

 

var panel = $find("<%=RadXmlHttpPanel1.ClientID%>");

 

 

var item = document.getElementById("<%=TextBox1.ClientID%>").value;

 

panel.set_value(item);

}

 

function OnRowSelectedHandler(sender, args) {

 

alert();

 

var item = args.getDataKeyValue("CustomerID");

 

 

var panel = $find("<%=RadXmlHttpPanel2.ClientID%>");

 

panel.set_value(item);

}

 

</script>

 

 

<asp:ScriptManager ID="ScriptManager1" runat="server">

 

 

</asp:ScriptManager>

 

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">

 

 

</telerik:RadAjaxLoadingPanel>

 

 

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

 

 

<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="OnClientClick();return false;" />

 

 

<telerik:RadXmlHttpPanel ID="RadXmlHttpPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1"

 

 

OnServiceRequest="RadXmlHttpPanel1_ServiceRequest">

 

 

<uc6:ucXmlgrid ID="ucXmlgrid1" runat="server" />    //This is radgrid

 

 

</telerik:RadXmlHttpPanel>

 

 

<div style="padding-top: 10px">

 

 

<telerik:RadXmlHttpPanel ID="RadXmlHttpPanel2" runat="server" LoadingPanelID="RadAjaxLoadingPanel1"

 

 

OnServiceRequest="RadXmlHttpPanel2_ServiceRequest">

 

 

<uc5:ucXmlDetail ID="ucXmlDetail1" runat="server" />

 

 

</telerik:RadXmlHttpPanel>

 

 

</div>

 

 

</div>

Source code in ucXmlgrid1 is as below:

 

 

<telerik:RadGrid ID="rgCustomer" runat="server" AutoGenerateColumns="False" CellSpacing="0"

 

 

AllowMultiRowSelection="false" GridLines="None">

 

 

<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">

 

 

</HeaderContextMenu>

 

 

<MasterTableView DataKeyNames="CustomerID" ClientDataKeyNames="CustomerID">

 

 

<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

 

 

<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">

 

 

<HeaderStyle Width="20px"></HeaderStyle>

 

 

</RowIndicatorColumn>

 

 

<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">

 

 

<HeaderStyle Width="20px"></HeaderStyle>

 

 

</ExpandCollapseColumn>

 

 

<Columns>

 

 

<telerik:GridBoundColumn FilterControlAltText="Filter column column" UniqueName="column"

 

 

DataField="ContactName" HeaderText="Contact Name">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn FilterControlAltText="Filter column1 column" UniqueName="column1"

 

 

DataField="CompanyName" HeaderText="Company Name">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn FilterControlAltText="Filter column2 column" UniqueName="column2"

 

 

DataField="ContactTitle" HeaderText="Contact Title">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn FilterControlAltText="Filter column3 column" UniqueName="column3"

 

 

DataField="Address" HeaderText="Address">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn FilterControlAltText="Filter column4 column" UniqueName="column4"

 

 

DataField="City" HeaderText="City">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn FilterControlAltText="Filter column5 column" UniqueName="column5"

 

 

DataField="Country" HeaderText="Country">

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

<EditFormSettings>

 

 

<EditColumn FilterControlAltText="Filter EditCommandColumn column">

 

 

</EditColumn>

 

 

</EditFormSettings>

 

 

</MasterTableView>

 

 

<FilterMenu EnableImageSprites="False">

 

 

</FilterMenu>

 

 

<ClientSettings EnableRowHoverStyle="True">

 

<%

--<Selecting AllowRowSelect="True" />--%>

 

 

<ClientEvents OnRowSelected="OnRowSelectedHandler" />

 

 

</ClientSettings>

 

 

</telerik:RadGrid>

 

1 Answer, 1 is accepted

Sort by
0
Pero
Telerik team
answered on 28 Sep 2011, 04:10 PM
Hello Dayana,

I tried to reproduce your problem locally but didn't succeed. Could you please provide more information about the issue? The sample project that I tested is attached to the thread. What I am doing in it, is I am rebinding the grid on XmlHttpPanel callbacks, and then select a row in the grid.

Greetings,
Pero
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
AJAX and Web 2.0
Asked by
Dayana Maliyakal
Top achievements
Rank 1
Answers by
Pero
Telerik team
Share this question
or