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

anyone having sourcedragnode be unreliable?

1 Answer 19 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
David Avery
Top achievements
Rank 1
David Avery asked on 10 Aug 2011, 10:27 PM
I am having an issue where the e.sourcedragnode on my drop event is not the same node that is highlighted with the client side highlight, and not the one I dragged.  This is persisting with the latest version of the control.  I also find that if I highlight a node, then refresh the control (using ajax) My focused tree node moves up one.  When I drag, the node before the one I have selected is being dragged.

I have sent a request into support, but they don’t know of any known issues, I wanted to check with the community to see if anyone is having this issue?

Note in the attached, I dragged the right most red box with the arrow, and my "sourceDragnodetext" is that of the node just before it.  Very weird.  This does not happen all of the time, it seems like it can get "out of sync".  Anyone?

1 Answer, 1 is accepted

Sort by
0
David Avery
Top achievements
Rank 1
answered on 11 Aug 2011, 04:52 PM
Adding to the issue, and documenting here.  I have a workaround, but I don't like it, it makes the "text" of the node unusable by me.

To support:
I found the issue, and a workaround - I think I should make you aware though, it's possibly to be considered a bug.

Note the bolded lines, surrounded by "If Not dsr("ScanDate") Is System.DBNull.Value Then"

In certain conditions, I need to show a little icon that indicates that a container was scanned.  I did this per a tech note by adding a "literal" control to the node.   When I do this, the node I select per the image I had sent is offset by 1, so there must be some sort of indexing conflict.  If I select node 2, on any postback, the selected node is 1 less than the one that I see selected.  By modifying the text as you see as the second line from the bottom, it works properly.  Is there a way I can do the literal text way as shown?

Private Sub tvShipBasket_NodeDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles tvShipBasket.NodeDataBound
    Dim dsr As DataRowView = e.Node.DataItem
    e.Node.Attributes.Add("xtype", dsr("Type").ToString())
    e.Node.Attributes("ivpartid") = dsr("IVPartID").ToString()
    e.Node.Attributes("propertynumber") = dsr("propertynumber").ToString()
    e.Node.Attributes("owncustomernumber") = dsr("owncustomernumber").ToString()
    e.Node.Attributes("crateid") = dsr("crateid").ToString()
    e.Node.ImageUrl = "~/images/" + dsr("image")
    e.Node.ExpandedImageUrl = "~/images/" + dsr("ImageExpanded")
 
   
If Not dsr("ScanDate") Is System.DBNull.Value Then
        'Dim lit As New WebControls.Literal()
        'lit.Text = String.Format("{0} <img src='/images/icnBarCode.gif' alt='{1}'></img>", dsr("NodeText"), dsr("ScanDate"))
        'e.Node.Controls.Add(lit)
        e.Node.Text = String.Format("{0} <img src='/images/icnBarCode.gif' alt='{1}'></img>", dsr("NodeText"), dsr("ScanDate"))
    End If

Tags
TreeView
Asked by
David Avery
Top achievements
Rank 1
Answers by
David Avery
Top achievements
Rank 1
Share this question
or