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

Dropping grid row on RadTreeview - HtmlElement value is undefined

3 Answers 27 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Al
Top achievements
Rank 1
Iron
Iron
Iron
Al asked on 09 Jun 2015, 02:09 PM

Hi,

I have drag/drop working ok from a grid to treeview node using this code:

function RadGrid1_OnRowDropping(sender, args) {
 
    if (currentNode) {
        var fld = $get("<%= nodeValueHiddenField.ClientID %>");
        fld.value = currentNode.get_value();
        args.set_destinationHtmlElement(fld);

        //args.set_destinationHtmlElement(fld.id);// Have tried both options

    }
    else {
        args.set_cancel(true);
    }
}
 

 currentNode gets set using mouseover/out of the treeview, fld is a valid reference to my <input type="hidden"/> field. Whenever the server side event is fired (by ajax) though, e.HtmlElement is always the string "undefined":

protected void RadGrid1_RowDrop(object sender, GridDragDropEventArgs e)
{
    if ((!String.IsNullOrEmpty(e.HtmlElement)) &&
        (e.DraggedItems.Count > 0))
 

 

 

 

 

 

3 Answers, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 12 Jun 2015, 10:44 AM
Hi,

From the code it seems that you want to set a hidden field as an element over which the drop is performed which does not seem like a valid scenario. Could you please elaborate on the idea behind this?

Additionally can you please share with us the entire page markup and code-behind so we could examine the implementation and research what might be causing this behavior.

Regards,
Angel Petrov
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Al
Top achievements
Rank 1
Iron
Iron
Iron
answered on 15 Jun 2015, 07:05 AM

Hi Angel, I was trying to pass a value (or control reference) in to the event handler and the control happens to be a hidden control. I suppose there are other was to achieve my goal but it just looked like a bug.

What type of values should I set in set_destinationHtmlElement?

0
Angel Petrov
Telerik team
answered on 17 Jun 2015, 12:45 PM
Hi,

Generally the set_destinationHtmlElement should work when the drop is performed over an element which is not inside the grid. If however the dropped is performed over a grid our internal logic will determine which is the drop element. You can verify this by running the attached sample.

If you perform the drop over the div element or RadTreeView on the server you will receive the hidden field as a drop target. In the other case the respective grid element.

Regards,
Angel Petrov
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Al
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Angel Petrov
Telerik team
Al
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or