473,396 Members | 1,784 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,396 software developers and data experts.

Help with Advanced Datagrid binding

I am trying to bind one column of a datagrid to a seperate textbox and
the rest of the fields to a datagrid. the comments are too large to
fit in a datagrid so I created a textbox below the datagrid and need
it to hold the data for the current record selected in the datagrid.
Here is a part of the code.

'DataSetWellMobile1 is the dataset with all the data
'DGWellResults is the dtagrid I am binding the data to
'txtWellComments is the textbox that I need bound

Me.DataSetWellMobile1.Relations.Add( _
New DataRelation( _
relationName:="relWellInfo", _

parentColumn:=Me.DataSetWellMobile1.Tables("TblPeo ple").Columns("UniqueId"),
_

childColumn:=Me.DataSetWellMobile1.Tables("TblWell MobileInfo").Columns("PersonId"),
_
createConstraints:=True))

Me.DGWellResults.DataBindings.Add(New Binding("DataSource",
Me.DataSetWellMobile1.TblPeople.DefaultView, "relWellInfo"))

Me.txtWellComments.DataBindings.Add(New Binding("Text",
DataSetWellMobile1.TblPeople.DefaultView, "relWellInfo.Comments"))

The code binds everything but the currency manager does not change the
textbox to the next record when I select on the next record in the
datagrid.

What am I missing.
Thanks,
Brad
Nov 21 '05 #1
5 2272
Brad,

Maybe do I not understand you, however what you tell is simply to done using
this sample.

\\\Needs only one datagrid and a label on the form
Private dtVBreg As DataTable
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
CreateTables()
DataGrid2.DataSource = dtVBreg
Label1.DataBindings.Add("Text", dtVBreg, "Name")
End Sub
'only to create the table
Private Sub CreateTables()
dtVBreg = New DataTable("Persons")
dtVBreg.Columns.Add("Name")
dtVBreg.Columns.Add("Country")
For i As Integer = 0 To 6
dtVBreg.Rows.Add(dtVBreg.NewRow)
Next
dtVBreg.Rows(0).ItemArray = New Object() _
{"Herfried K. Wagner", "EU"}
dtVBreg.Rows(1).ItemArray = New Object() _
{"Ken Tucker", "US"}
dtVBreg.Rows(2).ItemArray = New Object() _
{"CJ Taylor", "US"}
dtVBreg.Rows(3).ItemArray = New Object() _
{"Jay B Harlow", "US"}
dtVBreg.Rows(4).ItemArray = New Object() _
{"Terry Burns", "EU"}
dtVBreg.Rows(5).ItemArray = New Object() _
{"Tom Shelton", "US"}
dtVBreg.Rows(6).ItemArray = New Object() _
{"Cor Ligthert", "EU"}
End Sub
///
I hope this helps?

Cor
Nov 21 '05 #2
I think you understand what I need to do. This normaly would work but since
I am using a DataRelation it does not work.
Thanks,
Brad
"Cor Ligthert" <no************@planet.nl> wrote in message
news:O1**************@TK2MSFTNGP10.phx.gbl...
Brad,

Maybe do I not understand you, however what you tell is simply to done using this sample.

\\\Needs only one datagrid and a label on the form
Private dtVBreg As DataTable
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
CreateTables()
DataGrid2.DataSource = dtVBreg
Label1.DataBindings.Add("Text", dtVBreg, "Name")
End Sub
'only to create the table
Private Sub CreateTables()
dtVBreg = New DataTable("Persons")
dtVBreg.Columns.Add("Name")
dtVBreg.Columns.Add("Country")
For i As Integer = 0 To 6
dtVBreg.Rows.Add(dtVBreg.NewRow)
Next
dtVBreg.Rows(0).ItemArray = New Object() _
{"Herfried K. Wagner", "EU"}
dtVBreg.Rows(1).ItemArray = New Object() _
{"Ken Tucker", "US"}
dtVBreg.Rows(2).ItemArray = New Object() _
{"CJ Taylor", "US"}
dtVBreg.Rows(3).ItemArray = New Object() _
{"Jay B Harlow", "US"}
dtVBreg.Rows(4).ItemArray = New Object() _
{"Terry Burns", "EU"}
dtVBreg.Rows(5).ItemArray = New Object() _
{"Tom Shelton", "US"}
dtVBreg.Rows(6).ItemArray = New Object() _
{"Cor Ligthert", "EU"}
End Sub
///
I hope this helps?

Cor

Nov 21 '05 #3
Brad,

I was thinking about however could not see that directly, before I do
something for nothing, you want to show from a child datagrid?

Cor
I think you understand what I need to do. This normaly would work but since
I am using a DataRelation it does not work.
Thanks,
Brad

Nov 21 '05 #4
Yes that is correct. If I navigate the parent datagrid the child changes
correctly. I just need to move one of the datacolumns from the child column
to seperate textbox.

Ex.
I navigate the parent DG and the Child changes correctly. I navigate the
child DG but the text box does not stay in sync with the selected record in
the child DG.

Does that make since?

Brad
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Brad,

I was thinking about however could not see that directly, before I do
something for nothing, you want to show from a child datagrid?

Cor
I think you understand what I need to do. This normaly would work but since I am using a DataRelation it does not work.
Thanks,
Brad


Nov 21 '05 #5
Brad,

I thought I did it once however that was another method.

I have the same problems as you. The currencymanager from the
relation.childtable seems to do nothing, I find this interesting will look
further, however have not direct an answer.

Cor
Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jeff | last post by:
IDE: VS 2003 :NET OS: XP Pro My app have a form with a tab-control on it. The tab-control have 2 tabpages. One of the tabpages displays a datagrid, and the other tabpage displays details (order...
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...
6
by: Alpha | last post by:
I have several textboxes that I need to chang the text when the selection row is changed in a datagrid. I have the following code. This textbox displayes the initial selection but when I click on...
2
by: Daniel | last post by:
I'm new to .Net and all of its abilities so I hope this makes sense. Basically I'm confused on when is the appropriate time to use web forms controls vs. regular HTML. For example in ASP...
9
by: John Robert | last post by:
Hi! Anyone has recommendations for advanced ASP.NET books? By advanced, I mean complicated stuff... not just authentification and datagrid binding I'm mainly interrested in learning more...
2
by: Brad Shook | last post by:
First of all thinks to Cor Ligthert for helping me with this last week. If you wild like to read Cor's comments please refer to the posting from 10/14/2004 and 8:48AM "Help with Advanced...
17
by: A_PK | last post by:
I have problem databinding the DataGrid with DataView/DataSet after the filter... I create the following proceudre in order for user to filter as many as they want, but the following code is only...
4
by: Jeff User | last post by:
Hi I tryed to solve this problem over in the framework.asp group, but still am having trouble. Hope someone here can help. using .net 1.1, VS 2003 and C# I have an asp.DataGrid control with a...
2
by: =?Utf-8?B?Y3JlYXZlczA2MjI=?= | last post by:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor information and the details loads the documents for that vendor in a datagrid. Everything is working fine until I click...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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,...

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.