Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Using Multiple events in Datagrid

Reply
Thread Tools

Using Multiple events in Datagrid

 
 
Dirk Vervecken
Guest
Posts: n/a
 
      01-20-2004
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.DataGridPageChangedEvent Args 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?
 
Reply With Quote
 
 
 
 
Dirk Vervecken
Guest
Posts: n/a
 
      02-02-2004
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.

http://www.velocityreviews.com/forums/(E-Mail Removed) (Dirk Vervecken) wrote in message news:<(E-Mail Removed). com>...
> 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.DataGridPageChangedEvent Args 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?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Events Events Events Please Help Chris ASP .Net Web Controls 0 08-30-2005 08:21 PM
order of events - dynamic checkbox events =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?= ASP .Net 0 08-17-2005 10:36 PM
How to add multiple buttons to a datagrid row... and handle their events AC ASP .Net Datagrid Control 1 01-01-2004 11:29 AM
Re: passing variables between web page events & httpmodules events Alvin Bruney ASP .Net 1 11-24-2003 04:14 PM
Passing Variables between Web Page Events and HttpModule Events shiv ASP .Net 0 11-21-2003 04:29 PM



Advertisments