[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 274
  • Last Modified:

problem calling datagrid page index change through event handler

i have an event handler as follows
      
private void InitializeComponent()
            {
                  this.MainWindowGrid.PageIndexChanged += new System.Web.UI.WebControls.DataGridPageChangedEventHandler(this.MainWindowGrid_PageIndexChanged);
                  
            }
my function (this.MainWindowGrid_PageIndexChanged) doesnt get called for the first time when i click any other page when my current page is the last page why so?
0
poogie22
Asked:
poogie22
  • 2
  • 2
1 Solution
 
jeebukarthikeyanCommented:
hi,

private void grid1_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
            {
                  try
                  {
                        this.grid1.CurrentPageIndex = e.NewPageIndex;
                        LoadData();
                  }
}

is ur datagrid pageindex like this

b u d d h a
0
 
poogie22Author Commented:
hi,
please tell me what to write if i want to check


if       (MainWindowGrid.CurrentPageIndex != e.NewPageIndex)

                  {    }

in  page load

thanks.
0
 
jeebukarthikeyanCommented:
hi,

u have any code to execute if the user is in last page

b u d d h a

0
 
poogie22Author Commented:
yes
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now