RadTaskBoard find item and scrolling into.

1 Answer 29 Views
TaskBoard
Mohamad
Top achievements
Rank 1
Mohamad asked on 23 Sep 2023, 01:27 PM

Hello,

My Radtaskboard contains dozens of items. How do I find an item and scroll to it so the user can find it?
I have made this code:


 foreach (taskboarddata item in MyRadTaskBoard.Items)
 {
     if (item.Id == itemidsearch)
     {
         this.MyRadTaskBoard.SelectedItem = item;


but only selection, the UI does not direct/point to the item.

Thank you for your help.

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 25 Sep 2023, 01:27 PM

Hello Mohamad,

I am afraid that there is no built-in method for this. You can manually calculate the scroll offset:

 var scroll = taskBoard.FindChildByType<ScrollViewer>();
 int itemIndex = 20; 
 var offset = (scroll.ScrollableWidth / taskBoard.Items.Count) * itemIndex;
 scroll.ScrollToHorizontalOffset(offset);

I hope this helps. Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Mohamad
Top achievements
Rank 1
commented on 26 Sep 2023, 06:43 AM

Hello Dimitar, 
Thank you for the response.
What I mean is scroll vertically down in the appropriate column. My taskboard has 4 columns. How do I find the right scroll viewer?
Dimitar
Telerik team
commented on 26 Sep 2023, 09:19 AM

Hi Mohamad, 

Can you send us a small sample project that shows your case? Perhaps with some sample data that shows how the control is populated.  This will allow us to properly investigate your case and provide a solution. 

Thank you in advance for your patience and cooperation. 

Tags
TaskBoard
Asked by
Mohamad
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or