Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Dock > Handling client event OnRowResized in server-side

Not answered Handling client event OnRowResized in server-side

Feed from this thread
  • Virgil Rodriguez avatar

    Posted on Dec 19, 2011 (permalink)

    Hello Telerik,

    I'm sorry, I should have posted this in the RadGrid section of the forum, but I was using RadDock within a RadGrid, that's why I instinctively posted this in the RadDock section.

    Anyways ... I hope you won't mind ... Thanks.

    How do you pass back to the server the event args in a OnRowResized event on the client-side?

    I got it to work in a OnRowClick event by having this statement in my code behind:

     

    RadGrid1.ClientSettings.EnablePostBackOnRowClick = True

    RadGrid1.ClientSettings.ClientEvents.OnRowClick = "On_Row_Click"


    AddHandler
    RadGrid1.ItemCommand, AddressOf RadGrid1_ItemCommand

     


    And in my .ASCX I have this:

     

    function On_Row_Click(sender, eventArgs) {

      __doPostBack(sender.ClientID, "RowClicked:" + eventArgs.get_itemIndexHierarchical());

    }

     

     

    When a row is clicked, it runs the __doPostBack command above and I catch the postback on the server side in my code behind:

     

    Private Sub RadGrid1_ItemCommand(sender As Object, e As GridCommandEventArgs)

       'Client-side event is caught here !!!

    End Sub

     

     


    How do I accomplish the same thing for a client-side OnRowResized event?

    If anyone can give a quick response (or a working example), it would be highly appeciated.

    Thanks.


    Reply

  • jumpstart Master avatar

    Posted on Dec 20, 2011 (permalink)

    Virgil:

    I am able to capture the event args from the OnRowResized client-side event in my application by specifying the following <ClientSettings> for my RadGrad:

    <ClientSettings>
        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        <Resizing ShowRowIndicatorColumn="true" AllowRowResize="true" EnableRealTimeResize="True"/>
        <Selecting AllowRowSelect="True" />
        <ClientEvents OnRowResized="OnRowResized" />
    </ClientSettings>

    and the following javascript event handler:

    <script type="text/javascript">
        function OnRowResized(sender, eventArgs) {
     
            __doPostBack(sender.ClientID, "Resizing row instance: " + eventArgs.get_itemIndexHierarchical());
        }
     
    </script>
     
    I am able to capture the arguments on the server side.

    Cheers!

    Reply

  • Virgil Rodriguez avatar

    Posted on Dec 21, 2011 (permalink)

    Hi Jumpstart,

    Thanks for your input. But, how do you trap the event on the server side after you do a __doPostback() on the client side?

    I was expecting the event to be captured by this on the server-side, but it did not:

    Private Sub RadGrid1_ItemCommand(sender As Object, e As GridCommandEventArgs)

       'Client-side event is caught here !!!

    End Sub


    What am I missing?

    Thanks again.


     

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Dock > Handling client event OnRowResized in server-side
Related resources for "Handling client event OnRowResized in server-side"

ASP.NET Dock Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]