Unable to retrieve contents on RowEditing (to cancel editing)
am 01.02.2008 17:59:47 von RaduHi. I have struggled for two hours now with this:
DataSourceID="SqlDataSource1"
DataKeyNames="ID"
AutoGenerateColumns="False"
ShowFooter="True"
OnRowUpdating="GridView1_RowUpdating"
OnRowEditing="GridView1_RowEditing"
OnRowDataBound="GridView1_RowDataBound"
Runat="server"
>
Eval("ActionTaken")%>
AutoPostBack="false"
DataSourceID="SqlDataSource2"
DataTextField="ActionTaken"
DataValueField="ActionTaken"
Runat="server">
DataTextField="ActionTaken"
DataValueField="ActionTaken"
Runat="server" Text='<%# Eval("ActionTaken")%>'>
protected void GridView1_RowEditing(object sender,
System.Web.UI.WebControls.GridViewEditEventArgs e)
{
String ActionType = ((DropDownList)
(GridView1.Rows[e.NewEditIndex].FindControl("ActionTakenComb oBoxEdit"))).SelectedValue;
if (ActionType.IndexOf("Manually") >= 0)
{
// Cancel the edit operation.
e.Cancel = true;
String strMessage;
strMessage = "You cannot edit this record.";
Response.Write("");
}
}