Open RadWindow from within RadGrid template column - image button

3 posts, 1 answers
  1. Gavin
    Gavin avatar
    2 posts
    Member since:
    Nov 2015

    Posted 04 Nov 2015 Link to this post

    On my aspx page I have a RadGrid with the following:

    <telerik:GridTemplateColumn HeaderText="View Order Details" UniqueName="OrderDetails">
    <ItemTemplate>
    <div style="vertical-align: middle; text-align: center;">
    <asp:ImageButton ID="btnOrder" ImageUrl="~\Content\Images\list.png" runat="server" Height="25px" Width="25px"  OnClick="openOrderDetails_Click"/>
    </div>
    </ItemTemplate>
    </telerik:GridTemplateColumn>

     

    I have also tried replacing the onclick method with the below and calling the relevant switch statement (after putting in the OnItemCommand in the grid) :

    CommandName="OrderDetails" CommandArgument='<%# Bind("identity") %>'

     

    I have a test button outside my radgrid and when I click on this the window opens without any issues:

    <telerik:RadButton ID="test" runat="server" Text="Test" Skin="MetroTouch" OnClick="openOrderDetails_Click"></telerik:RadButton>

     

    Can anyone help with getting this to open from the button within the grid

  2. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    4819 posts

    Posted 04 Nov 2015 Link to this post

    Hello Gavin,

    I advise you start from the following articles on opening a RadWindow:

    Thus, you can attach client-side handlers to the button that will do the job, much like shown in this demo: http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window (the handler is set from the code-behind but that is not really relevant).

    As for the original problem - it is most likely due to AJAX being used and the RadWindow not being updated, especially if you try to show it via its VisibleOnPageLoad property.

    Regards,

    Marin Bratanov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Gavin
    Gavin avatar
    2 posts
    Member since:
    Nov 2015

    Posted 04 Nov 2015 in reply to Marin Bratanov Link to this post

    Hi Marin,

    Attaching the client-side handlers to the button has done the trick! Thanks for the help with this

     Regards

    Gavin

Back to Top