Using Multiple events in Datagrid

Discussion in 'ASP .Net Datagrid Control' started by Dirk Vervecken, Jan 20, 2004.

  1. 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?
     
    Dirk Vervecken, Jan 20, 2004
    #1
    1. Advertising

  2. 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.

    (Dirk Vervecken) wrote in message news:<>...
    > 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?
     
    Dirk Vervecken, Feb 2, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. shiv
    Replies:
    0
    Views:
    482
  2. Alvin Bruney
    Replies:
    1
    Views:
    729
  3. =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=

    order of events - dynamic checkbox events

    =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=, Aug 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    568
    =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=
    Aug 17, 2005
  4. AC
    Replies:
    1
    Views:
    172
    Teemu Keiski
    Jan 1, 2004
  5. Chris

    Events Events Events Please Help

    Chris, Aug 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    379
    Chris
    Aug 30, 2005
Loading...

Share This Page