Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Relation in DataGrid '+' sign

Status
Not open for further replies.

IndyGill

Technical User
Jan 15, 2001
191
GB
Hi

I building a web app using VB.NET in VS.NET. I have put two tables into a dataset and have created a datarelation between them. I noticed that as sson a you create this DataRelation in .Net Windows Appication it puts a '+' sign in your datagrid automatically which show the relation.

However when I do this in a ASP.Net app it does not put the '+' sign in or show any of the relation data. How do I get it to show the datrelation in the datagrid by pressing a '+' sign in my web datagrid?

Many thanks in advance

Please find below my sample code:

Dim Conn As New SqlConnection(ConfigurationSettings.AppSettings("connBSS"))
Dim dsClients As New DataSet()

'Client Section
Dim strClientSQL As String = &quot;SELECT CltID, CltFirstNam, CltLastNam, CltAdd1 FROM Client WHERE CltID < 'BSS170'&quot;
Dim objClientAdapter As New SqlDataAdapter (strClientSQL, Conn)
objClientAdapter.Fill(dsClients, &quot;Clients&quot;)

'Client Other Info Section
Dim strCOIsql As String = &quot;SELECT * FROM ClientOtherInfo WHERE CltID < 'BSS170'&quot;
Dim objCOIAdapter As New SqlDataAdapter(strCOIsql, Conn)
objCOIAdapter.Fill(dsClients, &quot;ClientOtherInfo&quot;)

'Create Relation
dsClients.Relations.Add(&quot;Info&quot;, _
dsClients.Tables(&quot;Clients&quot;).Columns(&quot;CltID&quot;), _
dsClients.Tables(&quot;ClientOtherInfo&quot;).Columns(&quot;CltID&quot;))

'Bind to Datagrid
DataGrid1.DataSource = dsClients
DataGrid1.DataBind()

 
Have you ever found an answer for this question?

Greetz

VBMim
 
Search for nested datagrids on Google. ASP.NET's datagrid will not automatically show the "+" as the window's dg as you have seen. You would have to code for this in your grid.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top