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

Opening Modal popup from RadGrid button

1 Answer 1143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ra
Top achievements
Rank 1
Ra asked on 22 May 2008, 03:06 PM
Hi,

I have two buttons in each gridrow. One button(openDetail) is used to open detail page as a modal popup and another button "submit" raises itemcommand event and does some data processing.

The problem that I have is once i click submit, OpenDetail button stops working(page just refreshes but doesnt open detail page).

In Item_Created Event handler I have the following code

    int Id = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "DataId"));
               
              
               LBTN Namebtn = e.Item.FindControl("NameBTN") as BTN;
              
                Namebtn.Attributes["onclick"] = string.Format("return OpenDetail('{0}','{1}');", Id, e.Item.ItemIndex);

             

This is the OpenDetail javascript:

  function OpenDetail(id, rowIndex)
    {
       var grid = window[<%=Grid.ClientId%>];
               
        var rowControl = grid.MasterTableView.Rows[rowIndex].Control;
        grid.MasterTableView.SelectRow(rowControl, true);
                       
        window.radopen("Details.aspx?data=" + id, "Dialog");
        return false;
     }

      <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                <Windows>
                    <telerik:RadWindow ID="Dialog" runat="server" Title="Dialog" Height="400px"
                        Width="300px" Left="150px" ReloadOnShow="true" Modal="true"/>
                </Windows>
            </telerik:RadWindowManager>

Could you please tell me what I am doing wrong...

thanks..

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 27 May 2008, 06:15 AM
Hello Ra,

It's seems that you are using old RadGrid's client api. Please refer to this online demo in order to view working  
example of how to accomplish similar  to desired scenario.

Best wishes,
Rosen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Ra
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or