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

RadWindow Launch from RadGrid ItemCommand

1 Answer 227 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 1
Joel asked on 29 Apr 2011, 11:50 AM
Hi Guys, 

I have a problem Im hoping you can help me with.  

I have a RadGrid, with a RadFilter on it.  The RadFilter button is an ItemCommand on the RadGrid.  I have since put another ItemCommand on to call a RadWindow to display my insert record aspx page.  

However I cant seem to get the ItemCommand to link to the Call Function

Here is the ASPX Code
<CommandItemTemplate>
                    <telerik:RadToolBar runat="server" ID="RadToolBar1" OnButtonClick="RadToolBar1_ButtonClick Skin="WebBlue">
                        <Items>
                            <telerik:RadToolBarButton Text="Apply filter" CommandName="FilterRadGrid"
                            ImageUrl="~/Images/Refresh.gif"/>
                            <telerik:RadToolBarButton Text="Add new" CommandName="xInsert"
                            ImageUrl="~/Images/AddRecord.gif" />                 
                             
                        </Items>
                    </telerik:RadToolBar>
                     
                </CommandItemTemplate>


Here is my VB Code
Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs)
        If e.CommandName = "FilterRadGrid" Then
            RadFilter1.FireApplyCommand()
        Else
            If e.CommandName = "xInsert" Then
                Dim newWindow As New Telerik.Web.UI.RadWindow()
                newWindow.ID = "InsertWindow"
                newWindow.NavigateUrl = "~/XDW/EditPalletQty.aspx"
                newWindow.VisibleOnPageLoad = True
                RadWindowManager1.Windows.Add(newWindow)
 
 
            End If
 
        End If
    End Sub

The filter works great however I cant seem to get the RadGrid to fire.  I have also tried calling the client side javascript from the VB code however that didnt fire either.

Any help is appriciated.

Cheers
Joel

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 04 May 2011, 01:05 PM
Hi Joel,

Basically, as the ItemCommand event of radGrid is fired for on of the RadToolBar buttons, there is no reason for the event not fire when the other button is clicked. However, you can handle the RadToolBar OnButtonClick event to achieve your goal. I can see you have already handled the event. Do you have any code in the event handler?

All the best,
Iana
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Joel
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or