Creating relation between datagrid columnstyle & datagrid default col

I have a hierarchical datagrid, which of course contains parent and child rows.

There are four tables. One parent with three child (ren). For one child table I have created a tablestyle and its corresponding columnstyles.

The upper right of the hierarchical datagrid contain a little icon you can click which will expand or collapse the showing of the parent info.

When I click this icon, I get the following error:

"The 'PatientID' DataGridColumnStyle cannot be used because it is not associated with a Property or Column in the DataSource."

Following is my relation definition.

Dim parentCol As DataColumn
Dim childCol As DataColumn
' second of three relationships
parentCol = myDataSet.Tables("PatientInfo").Columns("PatientId")
childCol = myDataSet.tables("PatientAccts").Columns("PatientID")
' Create DataRelation.
Dim relInfoAccts As DataRelation
relInfoAccts = New DataRelation("InfoAccts", parentCol, childCol)
' Add the relation to the DataSet.
myDataSet.Relations.Add(relInfoAccts)

I believe the following syntax needs to be revised to show that a tablestyle and columnstyle are participating in the relation, but don't know how to do that.

childCol = myDataSet.tables("PatientAccts").Columns("PatientID")

Any help on this topic would be greatly appreciated!!!!

Many thanks

Gary




Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories