Sorting the nested HierarGrid by Denis Bauer

V

Vishal

Hi,

I am using Denis Bauers HierarGrid and would like to
sort the nested grid. However each time I do that, I get
the error message:

Please change the TemplateDataMode attribute to 'Table' in
the HierarGrid declaration.

Although this is already done. If I dont sort the inner
grid, then it works. Here is the structure of the inner
grid.

Private Sub XX_DataBind(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.DataBinding
BindData()
End Sub

Public Sub BindInvoiceItems()
'make sure that the TemplateDataMode to Table (because we
want nested grids)
Dim dgi As DataGridItem = CType
(Me.BindingContainer, DataGridItem)
If (Not (TypeOf (dgi.DataItem) Is DataSet)) Then
Dim ex As ArgumentException = New
ArgumentException("Please change the TemplateDataMode
attribute to 'Table' in the HierarGrid declaration")
Throw ex
End If

Dim ds As DataSet = CType(dgi.DataItem, DataSet)

dg.DataSource = ds
dg.DataMember = ds.Tables(1).TableName ' Load
child table
dg.DataBind()
End Sub

Sub dg_OnSortCommand(ByVal sender As Object, ByVal e As
DataGridSortCommandEventArgs)
'... Some view settings here to make sorting...
'rebind the data
BindInvoiceItems()
End Sub

I would appreciate any help. This is really urgent. Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top