I have an ASP DetailsView with a RadGrid in one of the Template Columns. What I would like to do is when I put my DetailsView into edit mode to add the edit and delete columns to the RadGrid. Right now I have it so in the DataBound event for the DetailsView I check if it's in edit mode and then add the "Add New Record" button. I have tried adding code to turn on the edit column but it doesn't work. See the code example below. Any help would be appreciated.
// Show the command display on edit
if
(((DetailsView)sender).CurrentMode== DetailsViewMode.Edit)
{
DropDownList ddl = (DropDownList)((DetailsView)sender).FindControl(
"DevicesLocation"
);
Label lbl = (Label)((DetailsView)sender).FindControl(
"lblLocationID"
);
LocationDropDown(ddl);
ddl.SelectedValue = lbl.Text;
// Show the command display on edit
ipAddressRadGrid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;
// Add edit column
ipAddressRadGrid.AutoGenerateEditColumn =
true
;
ipAddressRadGrid.Rebind();
}