Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > XmlHttpPanel > selected row index.

Answered selected row index.

Feed from this thread
  • Posted on Jul 25, 2011 (permalink)

    Hi,

    I'm using a radxmlhttppanel and I would like to know if there is a way to get the selected row index or selected row column value from the service request event?

    Thanks,

    Reply

  • Pero Pero admin's avatar

    Posted on Jul 27, 2011 (permalink)

    Hi Ron,

    I suppose you are referring to the RadGrid's selected row index or column. Since, the RadXmlHttpPanel uses ASP.NET callbacks this means that the control will not load and save its ViewState and its client state, which means the selected row index will not be available in the ServiceRequest event.
    You could however send the needed information from the client as parameter to the set_value method, and then access it on the server.

    Greetings,
    Pero
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

    Reply

  • Posted on Jul 27, 2011 (permalink)

    Understood, but I'm already using the set_value method for the radxmlhttppanel. I couldn't use it twice can I?

    Reply

  • Answer Pero Pero admin's avatar

    Posted on Jul 29, 2011 (permalink)

    Hello Ron,

    You could pass more than one argument to the set_value method in the following way:
    Client:
    <script type="text/javascript">
        function SetValue()
        {
            var panel = $find("<%=XmlPanel1.ClientID %>");
            var name = new Object();
            name.First = "George";
            name.Last = "Brown";
            panel.set_value(Sys.Serialization.JavaScriptSerializer.serialize(name));
        }
    </script>

    and access it on the server:
    protected void XmlPanel1_ServiceRequest(object sender, Telerik.Web.UI.RadXmlHttpPanelEventArgs e)
    {
        JavaScriptSerializer serializer = new JavaScriptSerializer();
        Object value = serializer.Deserialize(e.Value, typeof(Object));
        Dictionary<String, object> dict = (Dictionary<string, object>)value;
        XmlPanel1.Controls.Add(new LiteralControl(dict["First"].ToString() + " " + dict["Last"].ToString()));
    }

    Regards,
    Pero
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

    Reply

  • Posted on Aug 5, 2011 (permalink)

    This worked, I really appreciate your assistance with this one, plus you introduce me to something new which. I will be doing some reading on the javascript serializer to learn more.

    Thanks,
    Ron

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > XmlHttpPanel > selected row index.