VB.NET - Gridview in windows desktop application

Asked By Morne on 24-Dec-10 04:22 PM
Hi I am writing a Point of Sale software. I am stuck can someone please help me with the following. I have textboxes where you enter the information of a product that was bought e.g. Price, ect Now I insert that into a database. How do I get a gridview to refresh without closing and reopening the form? Please help Thanks
Danasegarane Arunachalam replied to Morne on 24-Dec-10 08:04 PM
You can combine Ajax to complete this functionality. Drag and Drop Script Manager and Update Panel in your application . And place the grid and button inside the panel. And in the button click event save and repopulate the grid. this won't show any reload on the page
bhaskar siddapuram replied to Morne on 24-Dec-10 09:11 PM

First of all write the binding functionality of gridview in a separate method like
Protected void bindGridView()
  DataTable dtTable = "GET Results into DataTable from DB"

  GridView.DataSource =dtTable;

Now complete  your update functionality in other method or button click event

protected void UpdateDB()
  // after your update statement simply call the above method.



That's it it will refresh the grid with new values.


Morne replied to Danasegarane Arunachalam on 25-Dec-10 02:55 AM
Hi I am looking for a method in a windows application not a web app. Thanks
Morne replied to bhaskar siddapuram on 25-Dec-10 03:10 AM
Hi will you please give me the code in vb.net

I can't get it converted in any converter online.