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

popup panel

1 Answer 120 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jaws1021
Top achievements
Rank 1
jaws1021 asked on 29 Jun 2010, 04:51 PM
I have radgrid1 for the inline editing and I have Edit, Add New Record, Delete links but also I added extra gridboundbutton called " search" and I wan to put a pop up panel for that in ItemCommand.. but my panel is not showing up.. I have searched that it says if I would have want to do my edit pop up panel I could have add EditMode = popup on the aspx page but I am not sure how to do that for the Search link, because I dont want to add pop up to Edit, Add new record , Delete functionalities.. just for Search .

 <radG:GridButtonColumn  ButtonType="LinkButton"
                          CommandName="Search" UniqueName="Search" >
                          <HeaderStyle />
                          <ItemStyle HorizontalAlign="Center" />
                      </radG:GridButtonColumn>

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 30 Jun 2010, 11:01 AM
Hi na,

If you want to open a RadWindow instance from the RadGrid ItemCommand event handler, you can set RadWindow's VisibleOnPageLoad property to true. This will have it open when the page loads on the client.

However, if you do not need to perform any specific action on the server, you can avoid the round trip to the server and use some javascript to open the window right on the client.

To attach a client-side click event handler to the buttons in the GridButtonColumn, you can use RadGrid's ItemCreated event:

protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem item = (GridDataItem)e.Item;
        (item["Search"].Controls[0] as LinkButton).OnClientClick = "openWin(this, event); return false;";
    }
}

Now you can have a javascript function openWin() on your page that will open a RadWindow. Note that we return false at the end of the click handler to prevent the actual postback of the button. Also, you can pass any arguments needed to the openWin() function from the server.

All the best,
Veli
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
jaws1021
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or