0

I have a gridview that has paging enabled. The problem is depending on what the user clicks there are a couple of different ways to populate the datasource for the gridview.

So, if pages are generated I'm not sure how to differentiate between the datasources in the PageIndexChanging method of the gridview.

Ex.

  /// <summary>
/// PageIndexChanging
/// </summary>
protected void grdvStats_PageIndexChanging(object sender, GridViewPageEventArgs e)
{      
    // If gridview populated via this button click...
    // else poplulated via this linkbutton
}
Amarnath Balasubramanian
  • 9,300
  • 8
  • 34
  • 62
chobo
  • 31,561
  • 38
  • 123
  • 191
  • are you saying you are using the page index to select an entirely different set of data, rather than a section from a larger set? – lincolnk May 31 '12 at 19:57
  • I have to repopulate the table, but ya, it doesn't seem very efficient :) Either way, the problem still remains on how to figure out which datasource was used to populate the gridview – chobo May 31 '12 at 20:02
  • 1
    can't you store a key or something at bind time so you know what the last source was? – lincolnk May 31 '12 at 20:11

0 Answers0