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

Is't possible to add to columns were they can open the usercontrol ?

2 Answers 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lior
Top achievements
Rank 1
Lior asked on 25 Sep 2012, 09:18 PM
Hi,



I'm planning to add to buttons were they can open the usercontrol (Edit form), is it possible to do that ?



Thanks,

Ayoob

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 26 Sep 2012, 05:20 AM
Hi,

I suppose you want to show UserControl as edit form on clicking GridButtonColumn. Here is the sample code.
aspx:
<EditFormSettings EditFormType="WebUserControl" ></EditFormSettings>
<telerik:GridButtonColumn ButtonType="PushButton" Text="Edit" CommandName="Edit"></telerik:GridButtonColumn>

C#:
protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
   if (e.CommandName == "Edit")
    {
        e.Item.OwnerTableView.EditFormSettings.UserControlName = "UserControl.ascx";
     }
}

Thanks,
Shinu.
0
Lior
Top achievements
Rank 1
answered on 26 Sep 2012, 08:50 PM
that's great.
it works with ["CommandName="Edit"] only..

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