OnSubmit, display grid
-
Hello, Some parameters are entered on a form, on submit, based on values entered on form I have the results from the database bind onto a grid. That part is working. Now, I have selected the "allowpaging" option. When I click on Page 2(hyperlink), it comes back the initial form, with parameter listing. I have created an OnClick event where it collects the values from form, then set up a public variable, send this value to another sub to query the database and display results. any ideas would be helpful. Thanks so much for your time.
-
Hello, Some parameters are entered on a form, on submit, based on values entered on form I have the results from the database bind onto a grid. That part is working. Now, I have selected the "allowpaging" option. When I click on Page 2(hyperlink), it comes back the initial form, with parameter listing. I have created an OnClick event where it collects the values from form, then set up a public variable, send this value to another sub to query the database and display results. any ideas would be helpful. Thanks so much for your time.
If you can post some sample code than it will be great help for other user to answer. Let me ask you one thing you have set allowpaing='true' but do you write PageIndexChange event like below
protected void gridView_PageIndexChanging(object sender, GridViewPageEventArgs e) { gridView.PageIndex = e.NewPageIndex; gridView.DataBind(); }
If not then try this. Other wise just provide some code which is causing an issue so other user can look into that. Hope this will help. My DotNet Stuff -
If you can post some sample code than it will be great help for other user to answer. Let me ask you one thing you have set allowpaing='true' but do you write PageIndexChange event like below
protected void gridView_PageIndexChanging(object sender, GridViewPageEventArgs e) { gridView.PageIndex = e.NewPageIndex; gridView.DataBind(); }
If not then try this. Other wise just provide some code which is causing an issue so other user can look into that. Hope this will help. My DotNet Stuff -
Yes, I have allowpaging set to true. And also that piece of code for the PageIndexChanging. The issue is with submit button on the page which probably initialises the page, then how would the grid control work?