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

[Solved] Embedded RadGrid firing wrong event on Drag and Drop

8 Answers 238 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 2
Alex asked on 02 Jun 2009, 10:48 PM

Just upgraded to 2009 Q1 from 2008 Q3 and I'm having a weird problem.

 

I have an embedded RadGrid in a Radgrid (let's call them rdParent and rdChild for this post) and both have DragandDrop enabled but you cannot drag to each other (you cannot drag and drop from rdParent to rdChild and vice versa). There's a 3rd Radgrid that you can drag and drop to rdParent or rdChild, let's call this one rdCousin.

 

The scenario is both rdParent and rdChild are empty when you start and rdCousing is populated, you can then drag and drop from rdCousin to either rdParent or rdChild. You can put back rows from rdParent and rdChild to rdCousin.

When I move rows from rdCousing to rdChild or rdCousin to rdParent everything works great, if I move rows from rdParent to rdCousin it works great.

When I move rows from rdChild to rdCousin it doesn work, this worked in 2008 Q3 but doesn't work in 2009 Q1 anymore.

After looking at what is going on here's what I've found and what is weird:

rdChild is firing the rdParent rowDrop (rdParent_RowDrop) event and not it's own rowDrop (rdChild_RowDrop) event, naturally because this is an embedded control we are specifying which event it needs to use with the onRowDrop tag.

Here is the tag for the rdChild grid as you can see we are specifying the OnRowDrop, OnItemDataBound and the OnPreRender events on the grid.

<telerik:RadGrid ID="rdChild" runat="server" EnableEmbeddedSkins="False" GridLines="None" Skin="SunsetQ3" ShowHeader="False" OnRowDrop="rdChild_RowDrop" OnItemDataBound="rdChild_ItemDataBound" Width="440px" OnPreRender="rdChild_PreRender"

This issue just arose like I mentionned when we went from 2008 Q3 to 2009 Q1, this has been working since 2007.

Thanks for your attention

8 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 05 Jun 2009, 09:58 AM
Hi Alex,

Testing our most 2009.1.527 version of RadGrid does not show any weird behavior under the described scenario. We are using two RadGrids, the second is inside the first's NestedViewTeamplate. The two grids' RowDrop events fire properly. Could you please give us some details as to the scenario in which you are using RadGrid.

If the problem persists, please consider opening a regular support ticket where you can, if possible, provide us with a small runnable project demonstrating the misbehavior. Once we can reproduce the problem, we will be able to better assist you on the matter.

Regards,
Veli
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Alex
Top achievements
Rank 2
answered on 05 Jun 2009, 02:51 PM
I will build a small project over the weekend and post it, I am currently on a tight deadline and had to re-design my page to have the same functionality (the look is not the same as I am using the nested feature of the control, reason I didn't originally use this is it's not giving me the look and feel that was required).

One of the things you mentionned in your post is you have your 2nd grid nested in NestedViewTeamplate, I do not have it in NestedViewTeamplate it is simply a control in one of the columns.

Thanks
0
Alex
Top achievements
Rank 2
answered on 05 Jun 2009, 06:49 PM

Like I mentionned in my previous reply I was not using the NestedViewTeamplate but had my grid within a column of my parent grid, I was going down the route of the DetailTables but was unable to activate the drag and drop on the DetailTables.

After reading your post and you mentionning NestedViewTeamplate I went down that route and everything seems to be working now, the child grid is firing it's RowDrop event and not the parent RowDrop event.

I believe that dropping a grid in a column shouldn't cause that grid to fire any parent events though.

 

Thanks

0
Veli
Telerik team
answered on 08 Jun 2009, 08:43 AM
Hi Alex,

I am glad you found a solution to your problem. Nevertheless, I tested RadGrid with a GridTemplateColumn and another RadGrid inside, and, again, my RowDrop events are firing correctly for both grids. If you need a solution to this scenario not working at your site, or if you experience similar problems again, please, do not hesitate to request assistance from Telerik support.

Good luck with your project.

Sincerely yours,
Veli
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Puneet Jain
Top achievements
Rank 1
answered on 15 Mar 2010, 08:48 PM
I want to implement drag and drop on Detailtables with structure like Table1 -> Table 2 -> Table3
We are using Q3 2009, could you please provide an example. 


0
Veli
Telerik team
answered on 16 Mar 2010, 02:26 PM
Hello Puneet,

Implementing hierarchy and row drag drop is no different than a flat RadGrid. You can find attached a simplified example with 2 levels.

All the best,
Veli
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Puneet Jain
Top achievements
Rank 1
answered on 16 Mar 2010, 02:50 PM
Hi Veli,
Thanks for your quick response but it is still of no help as it gives following error: 
"The name 'MyData' does not exist in the current context"

Also, i need to implement it this way: 

1.) Have 3 level of hierarchy all showing data from different tables
2.) Update Sort order in DB as user do drag and drop. 
3.) Customized expand-collapse button as used in this demo 
4.) Show Grid in same state as it was before drag and drop.  


0
Veli
Telerik team
answered on 16 Mar 2010, 04:37 PM
Hello Puneet,

I have forgotten to attach the .cs class file containing the dummy data objects. You can find it attached now.

1. For three-level hierarchical grid, you would simply have another <DetailTables> collection inside the nested table:

<telerik:RadGrid>
    <MasterTableView>
        <DetailTables>
            <telerik:GridTableView>
                <DetailTables>
                    <telerik:GridTableView>
                    </telerik:GridTableView>
                </DetailTables>
            </telerik:GridTableView>
        </DetailTables>
    </MasterTableView>
</telerik:RadGrid>

To get started with setting up your grid hierarchy structure, you can refer to this RadGrid online help article. The other articles in the same section will help you when diving deeper into customizing your hierarchy setup.

2. I am not quite sure I understand what you mean by Update Sort order in DB as user do drag and drop. If you need to implement sorting at the database level, you can easily override the default sorting behavior of RadGrid and implement a custom one.

3. The example you are referring to demonstrates the self-referencing hierarchy feature of RadGrid. In the example, the default expand/collapse button is hidden and custom buttons are inserted in the first cell of each parent row. You can try the approach locally by running the RadControl Demo application shipped with your RadControls distribution. The same approach can be used for regular parent-detail hierarchical grid and there would be no difference in the implementation details for hiding the expand column and inserting custom buttons.

4. I am afraid I also do not understand what you mean by Show Grid in same state as it was before drag and drop. Can you clarify.

All the best,
Veli
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Alex
Top achievements
Rank 2
Answers by
Veli
Telerik team
Alex
Top achievements
Rank 2
Puneet Jain
Top achievements
Rank 1
Share this question
or