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

selected row index.

4 Answers 68 Views
XmlHttpPanel
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Ron asked on 25 Jul 2011, 12:36 PM
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,

4 Answers, 1 is accepted

Sort by
0
Pero
Telerik team
answered on 27 Jul 2011, 02:36 PM
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.

0
Ron
Top achievements
Rank 1
answered on 28 Jul 2011, 02:55 AM
Understood, but I'm already using the set_value method for the radxmlhttppanel. I couldn't use it twice can I?
0
Accepted
Pero
Telerik team
answered on 29 Jul 2011, 06:39 AM
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.

0
Ron
Top achievements
Rank 1
answered on 05 Aug 2011, 10:11 AM
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
Tags
XmlHttpPanel
Asked by
Ron
Top achievements
Rank 1
Answers by
Pero
Telerik team
Ron
Top achievements
Rank 1
Share this question
or