Using Multiple events in Datagrid

D

Dirk Vervecken

I'm currenty using a datagrid that contains 3 linkbuttons. With use of
the property Builder in VS, i've also allowed for the use of Paging.

But everything is going haywire. On the first page everything works as
it should. I can even go to the next page without any problems.
However, when I press the button to go back to the previous page,
it instead give me the function for the first linkbutton.
Also, if I try to use any of the linkbuttons at that time, I get
all the wrong values. I get instead, the values from the first page.

Each of the three linkbuttons triggers the ItemCommandEvent
Pushing the Next-Button triggers a PageIndexChangedEvent

The Previous Button gets the commandname of the first Linkbutton in
the Grid.

private void dgBudgetRider_PageIndexChanged(object source,
System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{ //The Pageindex is set to the new Index
dgBudgetRider.CurrentPageIndex = e.NewPageIndex;
//Grid
UnSelectie(); <- Sets the SelectedIndex to -1.

//Vorige waarde
ViewState.Remove("SelectedCode");

dgBudgetRider.DataBind();
}

Can anyone help me?
 
D

Dirk Vervecken

Never mind. I've already found what went wrong.
I had make a small mistake in initializing a Component
which retrieved the data for the Datagrid.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top