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

RadGrid ItemCommand fires on all events except button within grid

3 Answers 175 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Amy
Top achievements
Rank 1
Amy asked on 24 Nov 2010, 09:51 PM
I have a RadGrid which has a GridButtonColumn.  Until recently when clicking on the button image in the grid, the ItemCommand event was firing as expected and I was being redirected to another page as specified in the code behind.  As of yesterday, nothing happens when clicking on the button image in the grid though no code changes have occurred.

The ItemCommand event for the grid does fire when filtering or sorting columns in the grid, just not when clicking on the image button.

Here's the code in the aspx page for the first part of the RadGrid and the GridButtonColumn...
<telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AllowFilteringByColumn="true" AllowPaging="True" AutoGenerateColumns="False" Skin="tds" EnableEmbeddedSkins="false" AllowSorting="True" EnableLinqExpressions="false" >
    <MasterTableView HeaderStyle-HorizontalAlign="Center" dataKeyNames="intItemID, intItemTypeID" TableLayout="Fixed">
        <PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="true" Position="TopAndBottom" />
        <Columns>
            <%--Review--%>
            <telerik:GridButtonColumn UniqueName="btnReview" Text="Review" ButtonType="ImageButton" ImageUrl="/TestDevelopment/images/review.png" CommandName="review" HeaderStyle-Width="40px">
            </telerik:GridButtonColumn>

I am able to see the button and the image is the one specified in the 'ImageURL'.

Here is the code in the .vb page for the ItemCommand event, note I've commented out the code that would appear in the 'If' statement with just a comment line for security/privacy reasons:
Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
        If e.CommandName = "review" Then
                  //redirect page here
                End If
End Sub

In debug mode, I have a breakpoint on the 'If' line in the ItemCommand and when sorting or filtering on the grid the breakpoint is hit.  However, when clicking on the image button in the grid the breakpoint is never hit.

Could someone provide any suggestions as to what may have caused this?
Thanks!

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 29 Nov 2010, 10:29 AM
Hi Amy,

I tried to replicate the described problem but to no avail.I have attached a sample project that is working as expected. Check it out and let me know how it works for you and if there is something unclear.

Kind regards,
Pavlina
the Telerik team
Browse the vast support resources we have to jumpstart 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.
0
Amy
Top achievements
Rank 1
answered on 29 Nov 2010, 04:55 PM
Pavlina,  thank you very much for your response and the sample project!

I was able to resolve the issue by essentially re-creating the aspx and vb page.  The only thing I can think of which may have caused this issue was a file conflict when checking the file into our source control application.  Perhaps something happened in resolving the conflict.

Thank you again for your time and help!!
0
Pavlina
Telerik team
answered on 01 Dec 2010, 12:18 PM
Hi Amy,

I am glad you have resolved the issue. In case you experience any further problems, do not hesitate to contact us again!

Best wishes,
Pavlina
the Telerik team
Browse the vast support resources we have to jumpstart 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
Amy
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Amy
Top achievements
Rank 1
Share this question
or