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

Dynamic (Programmatically Added) Toolbar To CommandItemTemplate

1 Answer 188 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 05 Feb 2015, 04:15 PM
Let me preface this by stating that I am defining all of the RADGrid layout design using server-side code.
The DLL Version is: 2012.2.724.35 (And before it is said, no I can not upgrade, I am currently stuck at this version)
     - If the problem is because of a bug in the version I have, just let me know and I will just abandon this idea and find an alternative.

So I have a RADGrid using a RADToolbar at the top of the grid.

The problem I am having is two-fold...
  1. The RADToolbar Buttons do not cause a postback. Viewing the html source after the page is rendered shows no java code at all within the RADToolbar.
    How do I get these buttons on the Toolbar to actually postback?
    The RADToolbar has AutoPostBack = True and each RADToolbarButton has PostBack = True
  2. If I render the RADToolbar into the grid, the "Pager" items (Prev, Next, Page#, etc) kick off the Ajax call which displays the LoadingPanel, but gets "stuck"...
    The loading panel never goes away. Debugging the page reveals an error in jquery-ui.min.js:
                            Unable to get property 'push' of undefined or null reference
    No other information is show about the error...so I am at a loss on this one. This error happens only when the RADToolbar is used.

That being said, I have a RADGrid where I set the following:
.CommandItemDisplay = Telerik.Web.UI.GridCommandItemDisplay.Top
.CommandItemSettings.ShowAddNewRecordButton = False

Now, I have server-side code that dynamically creates a RADToolbar and adds it to the RADGrid's MasterTableView.CommandItemTemplate...
Me.RADGrid.MasterTableView.CommandItemTemplate = New Template_RADToolbar(Me._objRADToolbar)

My custom ITemplate is:
Private Class Template_RADToolbar : Implements ITemplate
    Protected _objRADToolbar As RadToolBar
 
    Public Sub New(ByRef p_objRADToolbar As RadToolBar)
        Me._objRADToolbar = p_objRADToolbar
    End Sub
 
    Public Sub InstantiateIn(container As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn
        container.Controls.Add(Me._objRADToolbar)
    End Sub
End Class


1 Answer, 1 is accepted

Sort by
0
Ben
Top achievements
Rank 1
answered on 05 Feb 2015, 08:58 PM
I found my answer...to bad there is no delete option for a thread.

It was a jQuery function that was running which interfered with the Telerik RADToolbar control.
Tags
Grid
Asked by
Ben
Top achievements
Rank 1
Answers by
Ben
Top achievements
Rank 1
Share this question
or