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

Sending information on RowDrop server side event

1 Answer 80 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Giovanni Soldi
Top achievements
Rank 1
Giovanni Soldi asked on 10 Jan 2011, 09:14 AM
Hello,

I'm trying to send more information to process on the server side when a RadGrid Row is dropped. The issue is that the default postback event is very limited. You can't for example pass a simple string with a value. Right now the only solution I can think of is cancelling the RowDrop event in the client side and do another postback this time with my data passed in. Does anyone know another way to do it?

Seems very limited that you can have only a destination HTMLElement and a destination DataItem. Would be cool another argument let's say for passing arbitrary data.

1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 10 Jan 2011, 04:30 PM
Hello Giovanni,

You can pass values through a hidden field. See the code snippets bellow:

ASPX:
<asp:HiddenField runat="server" ID="HiddenField1" Value="Default" />
<telerik:RadCodeBlock runat="server" ID="RadCodeBlock1">
  <script type="text/javascript">
    document.getElementById('<%=HiddenField1.ClientID%>').value = "Some text set on client";
  </script>
</telerik:RadCodeBlock>
<telerik:RadGrid ID="RadGrid1" runat="server" onrowdrop="RadGrid1_RowDrop">
C#:
protected void RadGrid1_RowDrop(object sender,
         Telerik.Web.UI.GridDragDropEventArgs e)
{
    String passedValue = HiddenField1.Value;
}

Regards,
Vasil
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.
Tags
Grid
Asked by
Giovanni Soldi
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Share this question
or