Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
Status: New
XamDataTree ScrollNodeIntoView method is not showing selected node inside the view need to scroll down to see it

In our case we are loading the node details when user click on the root node which we have only one root node so scroll node into view calculation will not work. May be pixels level we need to bring the found node in the middle of the view

passing the node details into ScrollNodeIntoView will not bring the found node into the view because the found node might be the last item on that tree

calculate how many pixels should we scroll

get selected node display TRect object details DR

get XamDataTree client TRect object details  CR

calculate scroll pixel lines using formula ScrollPx  = - Round((CR.Bottom / 2) - DR.Top - ((DR.Bottom - DR.Top) / 2));

  how many lines does it correspond to
    ScrollLines := ScrollPx div XamDataTree_GetItemHeight(XamDataTree1.Handle);

check ScrollLines > 0  inside loop pass WM_VSCROLL perform linedown for each line

check ScrollLines < 0 inside loop pass WM_VSCROLL perform lineup for each line 

Thanks

Kanex.Siva