Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting CS0122 trying to set up DataGrid's Edit/Cancel/Update commands

Status
Not open for further replies.

DLLHell

Programmer
May 9, 2003
69
US
I am getting an compilation error msg after adding the DataGrid's Edit/Cancel/Update/Delete linkcommands - any idea why this error is occurring?

CS0122: 'WebApplication1.WebForm1.DataGrid1_Cancel(object, System.Web.UI.WebControls.DataGridCommandEventArgs)' is inaccessible due to its protection level

HTML DataGrid1 setup:
<asp:datagrid id=DataGrid1 style=&quot;Z-INDEX: 102; LEFT: 10px; POSITION: absolute; TOP: 280px&quot; runat=&quot;server&quot; PageSize=&quot;13&quot; AutoGenerateColumns=&quot;False&quot; CellPadding=&quot;3&quot; BackColor=&quot;White&quot; BorderWidth=&quot;1px&quot; BorderStyle=&quot;None&quot; BorderColor=&quot;#E7E7FF&quot; Width=&quot;991px&quot; Height=&quot;216px&quot; DataSource=&quot;<%# dsBV1 %>&quot; DataMember=&quot;Prototype&quot; AllowSorting=&quot;True&quot;
OnCancelCommand=&quot;DataGrid1_Cancel&quot; OnEditCommand=&quot;DataGrid1_Edit&quot; OnUpdateCommand=&quot;DataGrid1_Update&quot; OnDeleteCommand=&quot;DataGrid1_Delete&quot;>

Code-behind:
void DataGrid1_Cancel(object sender, DataGridCommandEventArgs e)
{
DataGrid1.EditItemIndex = -1; //just to get started
}
 
uhhh *slaps* forehead nemmind. It's always the little things....

needed a Public void.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top