Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sync Grid with Combox
Message
General information
Forum:
ASP.NET
Category:
WebForms
Miscellaneous
Thread ID:
00718353
Message ID:
00718565
Views:
13
Hi Roland,

I would recommend looking at using DataBindings for your controls. Here is the online help information:

ms-help://MS.VSCC/MS.MSDNVS/vbcon/html/vbconConsumersOfDataOnWindowsForms.htm

I would also recommend a book called "User Interfaces in VB.NET" or "User Interfaces in C#". Both of these books talk a lot about how to bind to multiple controls and have them interact.

>Hi,
>
>My winform has a grid , textboxes, and a combobox.
>
>IT ALL MOST WORKS!!
>
>When the program starts the grid show 4 for jobtype (1st row) but the combobox show sales (which is a 1). downarrow to next row and the grid for 1st row change the job type to 1. if you change the combobox to misc which is a 4 before you downarrow the grid jobtype remains a 4. After the first movement the combobox seems to work as desired. the following is the code to fill and make the relationship to the tables in the same dataset. What code would you add to "sync" the two tables before the End Sub?
>
>Also if I make a selection from the ComboBox The grid field does not change until after I select a different row in the grid. This too must be a "Sync" Problem! Are both related or do I need additional code somewhere?
>
> Private Sub Agent01_Form_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
> Me.SqlDataAdapter1.Fill(Agents01_Form_Ds1)
> Me.SqlDataAdapter2.Fill(Agents01_Form_Ds1)
> Agents01_Form_Ds1.Relations.Add("AgentJobType", Agents01_Form_Ds1.Tables("Agents").Columns("JobType"), Agents01_Form_Ds1.Tables("PersonnelType").Columns("PersonnelTypeNum"))
>
> End Sub
>
>By the way both fields are ID fields are int but the names are not the same, but will be changed in the future. (JobType and PersonnelTypeNum are actually the same, the JobType)
>
>Thanks
>Roland
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform