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

[Solved] AllowPostBackOnRowClick problem

3 Answers 160 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Luke
Top achievements
Rank 1
Luke asked on 12 Nov 2009, 02:26 PM

Posted 3 hours ago (permalink)

Hi!

This is my problem: I set the attribute EnablePostBackOnRowClick on true in ClientSettings of RadGrid, then I added a GridTemplateColumn with ItemTemplate and EditTemplate. Finally inside ItemTemplate I got asp:buttons, but every time I try to click on them, the row-click event is fired before. I tried a solution found around here (this one!) regarding the stop of propagation (by using some javascript), but it does not work.

Any idea?

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 12 Nov 2009, 03:14 PM
Hi Luke,

Please examine the following help article which elaborates on this subject and let me know if it helps to achieve the desired functionality:
Enabled/Disabled conventions

Greetings,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Luke
Top achievements
Rank 1
answered on 12 Nov 2009, 03:45 PM
Unfortunately looking through the code I realized it's not what I'm looking for, because the behaviour of the events of RadGrid is pretty strange (I forgot to say a thing: I'm a little newbie about RadControls) and even the article that you suggest me doesn't fit for my issue.

I try to explain it better, this is my ascx:

<telerik:RadGrid OnItemCommand="Method" ...etc... > 
    <ClientSettings EnablePostBackOnRowClick="true"></...> 
    <%-- several GridTemplateColumns --%> 
    <telerik:GridTemplateColumn ...etc...> 
        <EditItemTemplate> ...whatever... </...> 
        <ItemTemplate> 
            <asp:button OnClick="AnotherMethod"/> 
        </...> 
    </...> 
</...> 


I must find a way to click on the asp:button, because every time I try to click on it the event row-click (and Method of OnItemCommand is executed) is fired before. I tried to put OnClientClick in asp:button in order to try to disable the RowClick of RadGrid (stopping the propagation at least), but again the event row-click of RadGrid is fired before... before of everything! The nested events (don't care if server or client side) of the elements of ItemTemplate are totally ignored...

I forgot to say that on the remaining columns the RowClick is ok, but not on the last or the middle one where the asp:buttons are.
0
Pavlina
Telerik team
answered on 17 Nov 2009, 01:13 PM
Hi Luke,

You can refer to the following forum link where a similar scenario is discussed.
http://www.telerik.com/community/forums/aspnet-ajax/grid/enablepostbackoenablepostbackonrowclick-true-other-button-on-grid.aspx

Regards,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Luke
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Luke
Top achievements
Rank 1
Share this question
or