Good morning,
I've a old code for delete row of Grid.
I've a Bound Column in grid
<
telerik:GridBoundColumn
UniqueName
=
"WebUserCode"
DataField
=
"WebUserCode"
Display
=
"false"
/>
and a Grid ButtonColumn
<
telerik:GridButtonColumn
ButtonType
=
"ImageButton"
CommandName
=
"Delete"
ConfirmDialogType
=
"RadWindow"
ConfirmText
=
"Confermare l'eliminazione del record ?"
ConfirmTitle
=
"Conferma eliminazione"
ImageUrl
=
"~/Images/16x16/delete2.png"
ItemStyle-HorizontalAlign
=
"Center"
ItemStyle-Width
=
"3%"
Text
=
"ELIMINA DATO"
UniqueName
=
"DeleteColumn"
HeaderText
=
"ELIMINA"
>
<
ItemStyle
HorizontalAlign
=
"Center"
Width
=
"3%"
/>
</
telerik:GridButtonColumn
>
this is the old code
protected
void
gvList_DeleteCommand(
object
sender, GridCommandEventArgs e)
{
GridDataItem row = gvList.Items[e.Item.ItemIndex];
try
{
item.Delete(Int32.Parse(row.Cells[2].Text));
}
catch
(Exception ex)
{
notError.Title =
"ELIMINAZIONE FALLITA"
;
notError.Title =
"L'ELIMINAZIONE DEL DATO HA CAUSATO PROBLEMI"
;
notError.Show();
WebTools.SendMailError(((System.Web.UI.TemplateControl)(
this
.Page)).AppRelativeVirtualPath, System.Reflection.MethodInfo.GetCurrentMethod().Name, ex, WebUser);
}
PopulateGridView();
}
The problem is that with the last version of RadGrid row.Cells[2].text is NULL, I think for the Visible="False" property.
How can I access at the bound column for to know the code of the record ?
Thanks