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

Why is my itemcontrol not firing... strange!

3 Answers 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
SK
Top achievements
Rank 1
SK asked on 02 Oct 2012, 01:39 AM
I have a strange problem. I am using a UserControl (say UserControlA) that has a RadGrid on it which is inside another UserControl (say UserControlB) that is Ajax enabled with RadAjax. So it looks like this:


Page > UserControlB (Ajax Enabled) > UserControlA > RadGrid


On a test page this works fine with the ItemCommand of RadGrid firing properly.


Now when I put the UserControlB in my final page (that has many other controls), the ItemCommand of the RadGrid does not fire at all! The funny thing is that this page has many other usercontrols that has its own grid which fires just fine!


So, the only thing I can think of is the Ajax Enabled UserControlB.


The ItemCommand is used in the straignt forward way:


...
        <telerik:GridTemplateColumn HeaderText="Actions">
            <ItemTemplate>
                <asp:Panel id="iconsPanel" runat="server" Visible="<%# IsActionVisible() %>">
                <asp:ImageButton ID="btnDelete" runat="server"ImageUrl="~/images/icons/Small/delete.gif"
                    ToolTip="Delete Document" CommandName="Delete" />
                    </asp:Panel>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
...


Then I am using normal DataSource() and DataBind()


finally the ItemCommand is created as:


private void InitializeComponent()
   {
       this.Init += new System.EventHandler(this.Page_Init);
       this.Load += new System.EventHandler(this.Page_Load);
       grdDocuments.ItemCreated += newTelerik.Web.UI.GridItemEventHandler(grdDocuments_ItemCreated);
       grdDocuments.ItemDataBound += newGridItemEventHandler(grdDocuments_ItemDataBound);
       grdDocuments.ItemCommand += newGridCommandEventHandler(grdDocuments_ItemCommand);
   }


Any ideas on how to proceed? I am running out of options, tried many things but nothing worked! 

3 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 02 Oct 2012, 08:05 AM
Hello,

There is not such type of issue with RadGrid.

1. Then also try with below property.

<asp:ImageButton CausesValidation="false"

2. In-addition also check that there is any JavaScript issue is raised after click on Delete ImageButton.

3. Also try with Temporary remove /comment your ajax code and check.


Thanks,
Jayesh Goyani
0
SK
Top achievements
Rank 1
answered on 02 Oct 2012, 11:13 AM
1. Tried the causes validation but it did not work

2. Created another column with no javascript and that column also did not fire the ItemCommand

3. Tried EnableAjax=false but that did not work also!
0
Jayesh Goyani
Top achievements
Rank 2
answered on 02 Oct 2012, 04:31 PM
Hello,

Please use Grid / Advanced Data Binding for binding your grid. Ignore if you already used.

Sorry but Can you please provide your code or submit your project by using support ticket?

Thanks,
Jayesh Goyani
Tags
Grid
Asked by
SK
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
SK
Top achievements
Rank 1
Share this question
or