abc
abc

Reputation: 2437

multiple edit columns in telerik radgrid

I have a telerik-radgrid where I use an editcolumn. For the edit-column I use a webusercontrol, I created. This works fine.

But know there should be two editlinks. Depending on which he chooses, i want to show a different usercontrol.

when i create two GridEditCommandColumns i get an error, because of two columns with the same id "EditButton"

I don't want to put the whole content of the usercontrols into one and show just the content needed, although this would work. But the controls are quite big and it wouldn't be fine to work with it afterwards.

How can I use two Edit-Columns in one radgrid?

Thank you

Upvotes: 4

Views: 2394

Answers (1)

abc
abc

Reputation: 2437

I found it out myself

I created a GridButtonColumn with the command Edit and a GridEditCommandColumns where i assign one of my usercontrols to it.

when it comes to the EditCommand-Event I do following:

if (((LinkButton)e.CommandSource).Text == "Edit1") //The Title of EditColumn 1
{
    rgCases.MasterTableView.EditFormSettings.UserControlName = "WebUC1.ascx";
}
else
{
    rgCases.MasterTableView.EditFormSettings.UserControlName = "WebUC2.ascx";
}

Upvotes: 3

Related Questions