Hi,
I have a hierarchical dataset being bound to the gridview and the binding works well. The challenge I am running into is how to format the child gridview (child template). I am formatting the parent row format (hiding columns, setting their widths, etc...) via the grid's DataBindingComplete event handler, but how do I format the children rows format? As an example, I need to hide the first two columns in the child dataset.
Thanks
Ali M.
MORE INFO: I am getting two datasets and binding the grid to them as shown in the code below. I then depend on the DataBindingComplete event handler to control the visibility and size of the columns which works for the master dataset but don't know how to implement that for the child dataset. I would change the formatting logic if this is the wrong way to do it.
Thanks
I have a hierarchical dataset being bound to the gridview and the binding works well. The challenge I am running into is how to format the child gridview (child template). I am formatting the parent row format (hiding columns, setting their widths, etc...) via the grid's DataBindingComplete event handler, but how do I format the children rows format? As an example, I need to hide the first two columns in the child dataset.
Thanks
Ali M.
MORE INFO: I am getting two datasets and binding the grid to them as shown in the code below. I then depend on the DataBindingComplete event handler to control the visibility and size of the columns which works for the master dataset but don't know how to implement that for the child dataset. I would change the formatting logic if this is the wrong way to do it.
Thanks
_adapter =
New
SqlDataAdapter()
_adapter.SelectCommand = _cmdSelect
_adapter.Fill(
Me
.dsSync,
"Transactions"
)
', "MBDeviceAuthorization")
_adapter.SelectCommand = _cmdSelect2
_adapter.Fill(
Me
.dsSync,
"Details"
)
grdTransactionDetails.Tag =
"checkouts"
grdTransactionDetails.DataSource =
Me
.dsSync.Tables(
"Transactions"
)
' Me.BindingSource1
Dim
template
As
GridViewTemplate =
New
GridViewTemplate
template.DataSource =
Me
.dsSync.Tables(
"Details"
)
template.AllowAddNewRow =
False
template.AllowEditRow =
False
template.AllowDeleteRow =
False
template.EnableGrouping =
False
grdTransactionDetails.MasterGridViewTemplate.ChildGridViewTemplates.Add(template)
Dim
relation
As
GridViewRelation =
New
GridViewRelation(grdTransactionDetails.MasterGridViewTemplate)
relation.ChildTemplate = template
relation.RelationName =
"CheckoutItems"
relation.ParentColumnNames.Add(
"rowid"
)
relation.ChildColumnNames.Add(
"rowid"
)
grdTransactionDetails.Relations.Add(relation)