Hey,
Dynamically adding GridEditCommandColumns to my Grid in attempt to be able to edit chosen lines in a grid. The code to add them is below.
I do the same thing for the DetailTables. The problem I get is on the DetailTables the column just disappears entirely and on the MasterTable I get the following error:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: An error has occurred because a control with id 'ctl00$CPH1$ValueAddInfo$rgdTable$ctl00$ctl04$EditButton' could not be located or a different control is assigned to the same ID after postback. If the ID is not assigned, explicitly set the ID property of controls that raise postback events to avoid this error.
There doesn't seem to be any way to set the ID of the controls, so I can't take the advice that the error message suggests.
Dynamically adding GridEditCommandColumns to my Grid in attempt to be able to edit chosen lines in a grid. The code to add them is below.
If
ViewState(
"MasterEdit"
)
Is
Nothing
Or
Not
ViewState(
"MasterEdit"
) =
True
Then
Dim
editCol
As
GridEditCommandColumn
editCol =
New
GridEditCommandColumn
editCol.UniqueName =
"MasterEditColumn"
editCol.HeaderText =
""
editCol.HeaderStyle.Width = 20
editCol.ButtonType = GridButtonColumnType.ImageButton
editCol.EditImageUrl =
"~\img\edit.gif"
editCol.EditFormColumnIndex = 0
rgdTable.MasterTableView.Columns.Add(editCol)
ViewState.Add(
"MasterEdit"
,
True
)
End
If
I do the same thing for the DetailTables. The problem I get is on the DetailTables the column just disappears entirely and on the MasterTable I get the following error:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: An error has occurred because a control with id 'ctl00$CPH1$ValueAddInfo$rgdTable$ctl00$ctl04$EditButton' could not be located or a different control is assigned to the same ID after postback. If the ID is not assigned, explicitly set the ID property of controls that raise postback events to avoid this error.
There doesn't seem to be any way to set the ID of the controls, so I can't take the advice that the error message suggests.