This is a migrated thread and some comments may be shown as answers.

Detail table view Rebind Problem

2 Answers 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Yasar
Top achievements
Rank 1
Yasar asked on 08 Feb 2012, 01:09 PM
Hi,

I need to rebind the detail table view in item command, i'm using the following code

e.Item.OwnerTableView.Rebind(); but in this command through can not find column error.

please help me for this issue.

Regards,
Yasar

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 09 Feb 2012, 06:58 AM
Hello,

I cannot reproduce the issue at my end. Check the following demo which implements the same.
Grid / Programmatic Binding
Please elaborate your scenario if it doesn't help.

Thanks,
Princy.
0
GL
Top achievements
Rank 2
answered on 11 Apr 2012, 11:03 PM

I think I was having the same problem you were. I was using a window to edit a record in a detail table, and wanted to rebind just the detail table after the user clicked Save. Turns out you have to rebind the entire grid, then re-expand the detail tables. Here is how I did it.

    Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, _
        ByVal e As AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
    If e.Argument = "Rebind" Then
        grdTasks.MasterTableView.SortExpressions.Clear()
        Dim expandedItems As String = ""
        For Each gi As GridItem In grdTasks.MasterTableView.Items
            If gi.Expanded Then
                expandedItems += gi.ItemIndex & ","
            End If
        Next
        expandedItems = expandedItems.Substring(0, expandedItems.Length - 1)
        grdTasks.Rebind()
        Dim items As String() = expandedItems.Split(",")
        For cnt As Integer = 0 To items.Length - 1
            grdTasks.MasterTableView.Items(cnt).Expanded = True
        Next
    End If
End Sub

Tags
Grid
Asked by
Yasar
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
GL
Top achievements
Rank 2
Share this question
or