I see a few problems.
First you need to bind your GridView before you set the page index in the PageIndexChanging event. Also the evaluation of IsPostBack is redundant because, unless you are explictly calling this method from somewhere in your code on initial page load, IsPostBack will always evaluate to true. Here is what the code should look like:
DisplayCurrentPage()
GridView1.DataSource = myDataSet
GridView1.DataBind()
GridView1.PageIndex = e.NewPageIndex
Second, in your page load you make this call:
GetInventory(myDouble)
You have defined GetInventory as a function but are using it as a method. My suggestion would be to do something liket his:
Dim myDouble As Double = 0
GridView1.DataSource = GetInventory(myDouble)
GridView1.DataBind()
By doing things this way you dont have to worry about class level members (e.g. myDataSet and myDataTable) since the function will return a DataSet object. =]
So then you could change the call in your PageIndexChanging event to look like this:
DisplayCurrentPage()
GridView1.DataSource = GetInventory(<value>)
GridView1.DataBind()
GridView1.PageIndex = e.NewPageIndex
Without any changes to the code, myDataSet will remain empty because you only fill it with data on the initial page_load when you call GetInventory().
hth.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========