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

Is there a way to open RadWindow in "Add a Record" link which is provided by RadGrid?

1 Answer 35 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jin
Top achievements
Rank 1
Jin asked on 06 Sep 2012, 09:36 AM
Is there a way to open RadWindow in "Add a Record" link which is provided by RadGrid? I don't want to put a link in CommandTemplate and add js to open. 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 Sep 2012, 10:27 AM
Hi Jin,

Try the following code to achieve your scenario.
C#:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
        if (e.Item is GridCommandItem)
        {
            GridCommandItem item = (GridCommandItem)e.Item;
            Button img = (Button)item.FindControl("AddNewRecordButton");
            img.Attributes.Add("onclick", "ShowWindow();return false;");
        }
}
JS:
function ShowWindow()
 {
var window = radopen("RadWindow1", null);
}

Thanks,
Shinu.
Tags
Grid
Asked by
Jin
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or