Jeroen Eikmans
Top achievements
Rank 1
Jeroen Eikmans
asked on 25 Sep 2009, 08:00 AM
Hello,
A page in my webapp is set up as followed :
RadGrid
DetailTable
NestedView
RadMultiPage
RadPageView
RadGrid
I've set the EnablePostbackOnRowClick to true for both RadGrids.
However when i expand the first gird and the detailtable and click on a row in the second RadGrid there doesn't seem to be a postback. I hooked the ItemCommand event of both RadGrids and for the first RadGrid this is triggered with CommandName "RowClick" but for the second RadGrid the event isn't triggered at all.
Both RadGrid's are set up with the following properties
A page in my webapp is set up as followed :
RadGrid
DetailTable
NestedView
RadMultiPage
RadPageView
RadGrid
I've set the EnablePostbackOnRowClick to true for both RadGrids.
However when i expand the first gird and the detailtable and click on a row in the second RadGrid there doesn't seem to be a postback. I hooked the ItemCommand event of both RadGrids and for the first RadGrid this is triggered with CommandName "RowClick" but for the second RadGrid the event isn't triggered at all.
Both RadGrid's are set up with the following properties
<telerik:RadGrid ID="...RadGrid" runat="server" AutoGenerateColumns="False"
GridLines="None" AllowMultiRowSelection="true"
onitemcommand="...RadGrid_ItemCommand" OnNeedDataSource="...RadGrid_NeedDataSource" OnPreRender="....RadGrid_PreRender" >
<ClientSettings EnablePostBackOnRowClick="true" >
<Selecting AllowRowSelect="true" />
<ClientEvents OnRowContextMenu="RowContextMenu" OnRowCreated="OnRowCreated" />
</ClientSettings>
Anybody knows why the postback on the second RadGrid isn't triggered?
7 Answers, 1 is accepted
0
Hello Roel,
I followed your scenario in order to replicate the issue but to no avail. Please find attached a simple runnable application which handles the desired functionality. Give it a try and let me know if you have other questions.
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.
I followed your scenario in order to replicate the issue but to no avail. Please find attached a simple runnable application which handles the desired functionality. Give it a try and let me know if you have other questions.
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
Jeroen Eikmans
Top achievements
Rank 1
answered on 29 Sep 2009, 10:36 AM
Hello Pavlina,
I modified your application and modified the code as shown below (Both radgrids have clientsettings and OnItemCommand event)
In code behind i have this code for the itemcommand
I then set breakpoints on both if (e.commandName.... lines and then run the application.
When i expand an item and click a row in the second radgrid both ItemCommand events with CommandName "RowClick" are triggered. I would expect only the OrdersRadGrid to trigger the event. This happends every time i click a row
Also the OrdersRadGrid sometimes doesn't trigger the ItemCommand event at all (but i do get the CustomerRadGrid event in this case) This behaviour doesn't happen every time i click a row in the ordersRadGrid. I need to click several rows before it happends.
Could you see why this behaviour happends?
In my opinion the OrdersRadGrid_ItemCommand always needs to be triggered when i click a row in that RadGrid and the CustomerRadGrid doesn't need to trigger it in that case (only when i click a row in the CustomerRadGrid)
Thanks in advance!
Kind regards.
I modified your application and modified the code as shown below (Both radgrids have clientsettings and OnItemCommand event)
| <telerik:RadGrid ID="CustomerGrid" runat="server" AllowPaging="True" DataSourceID="AccessDataSource1" |
| AllowFilteringByColumn="true" Skin="Vista" OnItemCommand="CustomerGrid_ItemCommand" > |
| <ClientSettings EnablePostBackOnRowClick="true"> |
| <Selecting AllowRowSelect="true" /> |
| </ClientSettings> |
| <MasterTableView> |
| <NestedViewTemplate> |
| <telerik:RadGrid runat="server" AllowPaging="true" AllowMultiRowSelection="true" |
| OnNeedDataSource="OrdersGrid_NeedDataSource" ID="OrdersRadGrid" OnItemCommand="OrdersRadGrid_ItemCommand" > |
| <ClientSettings EnablePostBackOnRowClick="true"> |
| <Selecting AllowRowSelect="true" /> |
| </ClientSettings> |
| <MasterTableView> |
| </MasterTableView> |
| </telerik:RadGrid> |
| </NestedViewTemplate> |
| </MasterTableView> |
| </telerik:RadGrid> |
In code behind i have this code for the itemcommand
| protected void CustomerGrid_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) |
| { |
| if (e.CommandName == "RowClick") |
| { |
| } |
| } |
| protected void OrdersRadGrid_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) |
| { |
| if (e.CommandName == "RowClick") |
| { |
| } |
| } |
I then set breakpoints on both if (e.commandName.... lines and then run the application.
When i expand an item and click a row in the second radgrid both ItemCommand events with CommandName "RowClick" are triggered. I would expect only the OrdersRadGrid to trigger the event. This happends every time i click a row
Also the OrdersRadGrid sometimes doesn't trigger the ItemCommand event at all (but i do get the CustomerRadGrid event in this case) This behaviour doesn't happen every time i click a row in the ordersRadGrid. I need to click several rows before it happends.
Could you see why this behaviour happends?
In my opinion the OrdersRadGrid_ItemCommand always needs to be triggered when i click a row in that RadGrid and the CustomerRadGrid doesn't need to trigger it in that case (only when i click a row in the CustomerRadGrid)
Thanks in advance!
Kind regards.
0
Hi Roel,
I followed you scenario in order to replicate the issue but to no avail. Please examine this video and let me know if I am leaving something out while testing.
All the best,
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.
I followed you scenario in order to replicate the issue but to no avail. Please examine this video and let me know if I am leaving something out while testing.
All the best,
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
Jeroen Eikmans
Top achievements
Rank 1
answered on 02 Oct 2009, 02:23 PM
Hi Pavlina,
I examined your video and you're following exactly the same steps i did.
Difference between your test and mine is, i think, the browser version. I'm using IE8 and it looks like you're using IE7?
I just did another test with FireFox and there the problem doesn't appear.
So i think IE8 is doing something strange causing the ItemCommand event to be triggered on both RadGrids.
Can you check if you can reproduce the problem with this info?
Thanks for your help!
Kind regards.
I examined your video and you're following exactly the same steps i did.
Difference between your test and mine is, i think, the browser version. I'm using IE8 and it looks like you're using IE7?
I just did another test with FireFox and there the problem doesn't appear.
So i think IE8 is doing something strange causing the ItemCommand event to be triggered on both RadGrids.
Can you check if you can reproduce the problem with this info?
Thanks for your help!
Kind regards.
0
Hello Roel,
Indeed you are right and ItemCommand event is triggered on both RadGrids when the row from the child grid is selected. We will look into it and will get back to you with additional information.
Thank you in advance for your cooperation.
Kind 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.
Indeed you are right and ItemCommand event is triggered on both RadGrids when the row from the child grid is selected. We will look into it and will get back to you with additional information.
Thank you in advance for your cooperation.
Kind 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.
0
Accepted
Hi Roel,
It seems that the issue is connected with the events bubbling in IE8. In order to overcome this behavior you can try canceling the default action. For that purpose you can try using the preventDefault() method which cancels the event if it is cancelable, without stopping further propagation of the event.
Additionally, I prepared a sample project for you illustrating the suggested approach.
All the best,
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.
It seems that the issue is connected with the events bubbling in IE8. In order to overcome this behavior you can try canceling the default action. For that purpose you can try using the preventDefault() method which cancels the event if it is cancelable, without stopping further propagation of the event.
Additionally, I prepared a sample project for you illustrating the suggested approach.
All the best,
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
Jeroen Eikmans
Top achievements
Rank 1
answered on 09 Oct 2009, 06:36 AM
Hi Pavlina,
Using the code from your sample it now works perfectly.
Thanks for your help!
Kind regards,
Roel
Using the code from your sample it now works perfectly.
Thanks for your help!
Kind regards,
Roel