Hi I have an asp.net gridview control. I have used pagging but when I click on grid for pagging it shows the following error
Error: A Runtime Error has occurred.Do you wish to Debug?
Line: 4723
Error: Sys.WebForms.Pa geRequestManage rServerErrorExc eption: The GridView 'dgridAlarms' fired event PageIndexChangi ng which wasn't handled.
Here is code
[code=c#]
protected void Page_Load(objec t sender, EventArgs e)
{
if (IsPostBack) return;
FillAlarms("ALL ");
}
public MySite.AlarmLis t FillAlarms(stri ng type)
{
MySite.Alarms obAlarms = new MySite.Alarms() ;
//MySite.DataColl ection<MySite.A larms> obCollection = new MySite.DataColl ection<MySite.A larms>();
MySite.AlarmLis t obCollection = new MySite.AlarmLis t();
try
{
if (type == "ALL")
{
obCollection = obAlarms.GetAll Alarms(MySite.A larmRetrieveTyp e.All);
}
else if (type == "ACKNOWLEDG ED")
{
obCollection = obAlarms.GetAll Alarms(MySite.A larmRetrieveTyp e.Acknowledged) ;
}
else
{
obCollection = obAlarms.GetAll Alarms(MySite.A larmRetrieveTyp e.NotAcknowledg ed);
}
if (obCollection.C ount > 0)
{
dgridAlarms.Dat aSource = obCollection;
dgridAlarms.Dat aBind();
}
return obCollection;
}
catch
{
throw;
}
finally
{
}
}
}
[/code]
Here AlarmList is
[code=c#]
public class AlarmList : List<Alarms >
{
}
[/code]
[code=aspnet]
<asp:GridView ID="dgridAlarms " runat=server AllowPaging=tru e
onselectedindex changing="dgrid Alarms_Selected IndexChanging" ></asp:GridView>
[/code]
Error: A Runtime Error has occurred.Do you wish to Debug?
Line: 4723
Error: Sys.WebForms.Pa geRequestManage rServerErrorExc eption: The GridView 'dgridAlarms' fired event PageIndexChangi ng which wasn't handled.
Here is code
[code=c#]
protected void Page_Load(objec t sender, EventArgs e)
{
if (IsPostBack) return;
FillAlarms("ALL ");
}
public MySite.AlarmLis t FillAlarms(stri ng type)
{
MySite.Alarms obAlarms = new MySite.Alarms() ;
//MySite.DataColl ection<MySite.A larms> obCollection = new MySite.DataColl ection<MySite.A larms>();
MySite.AlarmLis t obCollection = new MySite.AlarmLis t();
try
{
if (type == "ALL")
{
obCollection = obAlarms.GetAll Alarms(MySite.A larmRetrieveTyp e.All);
}
else if (type == "ACKNOWLEDG ED")
{
obCollection = obAlarms.GetAll Alarms(MySite.A larmRetrieveTyp e.Acknowledged) ;
}
else
{
obCollection = obAlarms.GetAll Alarms(MySite.A larmRetrieveTyp e.NotAcknowledg ed);
}
if (obCollection.C ount > 0)
{
dgridAlarms.Dat aSource = obCollection;
dgridAlarms.Dat aBind();
}
return obCollection;
}
catch
{
throw;
}
finally
{
}
}
}
[/code]
Here AlarmList is
[code=c#]
public class AlarmList : List<Alarms >
{
}
[/code]
[code=aspnet]
<asp:GridView ID="dgridAlarms " runat=server AllowPaging=tru e
onselectedindex changing="dgrid Alarms_Selected IndexChanging" ></asp:GridView>
[/code]
Comment