473,405 Members | 2,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

reloading a datagrid with new data from a dataset

Hello,

I have a main form with a datagrid.

When I add I click a add button and another form (customer form) will open. I enter in the new data and click add customer button. The customer is saved in the database. After the another function will be called to get the new customer and fill a dataset for the datagrid datasource. However, the datagrid form does not show the new customer. I have to close the main form first and then re-open it.

This is the code i am using code for the add customer form.

I am using visual basic 2005 and sql server 2005. The datagrid is an ultragrid form infragisitics. But still functions the same way as a normal windows datagrid.

Expand|Select|Wrap|Line Numbers
  1. Private Sub btnAddNewContact_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddNewContact.Click
  2.  
  3.         Dim objInsertNewContact As New BL_Contacts()
  4.         clientID = objInsertNewContact.InsertNewContact(clientID, txtContactName.Text, txtPhoneNumber.Text, txtExtensionNumber.Text, txtAdditionalNumber.Text, txtEmail.Text, txtPosition.Text)
  5.  
  6.         Me.BindDataGrid()
  7.  
  8.     End Sub
  9.     Public Sub BindDataGrid()
  10.         Dim objNewCustomer As New NewCustomer()
  11.         Dim displayClientDetails As New BL_Clients()
  12.         Dim ds As New DataSet()
  13.  
  14.         ds = displayClientDetails.getClients
  15.         objNewCustomer.ultGrdNewContacts.DataSource = ds.Tables(0).DefaultView
  16.  
  17.         objNewCustomer.ultGrdNewContacts.DataBind()
  18.         objNewCustomer.ultGrdNewContacts.Refresh()
  19.  
  20.     End Sub
  21.  
Many thanks in advance,

Steve
Oct 12 '06 #1
0 1029

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Steve B. | last post by:
I have a DataGrid on the left and TextBoxes (TB) on the right. The TB's reflect the contents of the grid cells. Sorting of columns (both thru VS and programmatically) work fine except, when the...
3
by: Doug | last post by:
Hi I have the following code (not mine) that populates a datagrid with some file names. But I want to replace the datagrid with a combo box. private void OnCurrentDataCellChanged(object sender,...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
4
by: Rod | last post by:
I posted a message to this group yesterday asking how to pass parameters to a web form that is the source of an IFrame on a parent web form. I've gotten my answer, and it works. Thanks! Now I...
2
by: Bennett Haselton | last post by:
I know how to create a DataAdapter that loads data from a data source into a table in a typed DataSet, and how to set the DataSource and DataMember properties of a DataGrid so that at run time it...
3
by: CVerma | last post by:
Hi, I have an embedded datagrid within a datalist. I am not able to perfrom paging in the datagrid. Any ideas? Here is my code: Here is my Simplegrid.cs file: using System; using...
5
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated...
3
by: Datatable Dataset Datagrid help | last post by:
Hi I am somewhat confused, I am new at VB.net I use XML data, I have a datagrid, I created a datatable so that I can create a custom format like true is this graphic false is this graphic and...
0
by: steve1rm | last post by:
Hello, I have a main form with a datagrid. When I add I click a add button and another form (customer form) will open. I enter in the new data and click add customer button. The customer is...
8
by: Brock | last post by:
I am trying to populate a Crystal Report from data in my DataGrid. The reason for this is that I want the user to be able to change values without updating the database, but still have their report...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.