DataRowView ParentNodeId

2 posts, 0 answers
  1. Kjell
    Kjell avatar
    203 posts
    Member since:
    May 2011

    Posted 20 May 2015 Link to this post

    This work!

     

    If (TryCast(e.Node.DataItem, DataRowView))("NodeId").ToString() = 3 Then
        e.Node.AllowDrag = False
    End If

     

     This is not work

     

    If (TryCast(e.Node.DataItem, DataRowView))("ParentNodeId").ToString() = 3 Then
        e.Node.AllowDrag = False
    End If

    Get: Exception Details: System.FormatException: Input string was not in a correct format.

  2. Dimitar
    Admin
    Dimitar avatar
    281 posts

    Posted 25 May 2015 Link to this post

    Hello,

    It seems that the ParentNodeId data cannot be converted to integer and your comparison throws the exception. Check if that field contains some characters that cannot be parsed and trigger the exception. The following StackOverflow thread explains such a conversion issue.

    Regards,
    Dimitar
    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top