selected row index.

5 posts, 1 answers
  1. Ron
    Ron avatar
    113 posts
    Member since:
    Apr 2011

    Posted 25 Jul 2011 Link to this post

    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,
  2. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 27 Jul 2011 Link to this post

    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ron
    Ron avatar
    113 posts
    Member since:
    Apr 2011

    Posted 27 Jul 2011 Link to this post

    Understood, but I'm already using the set_value method for the radxmlhttppanel. I couldn't use it twice can I?
  5. Answer
    Pero
    Admin
    Pero avatar
    1156 posts

    Posted 29 Jul 2011 Link to this post

    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.

  6. Ron
    Ron avatar
    113 posts
    Member since:
    Apr 2011

    Posted 05 Aug 2011 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017