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

Limit max number of items

5 Answers 10 Views
LayoutControl
This is a migrated thread and some comments may be shown as answers.
paolo
Top achievements
Rank 1
paolo asked on 17 Jul 2018, 04:14 PM

Hello,

I was wondering if there's a simple way to limit at max 6 items the number of items present inside a LayoutControl? I've added a control inside my ViewModel and I avoid adding more if the Count reaches 6 but the whole space is not occupied

 

Thanks in advance

5 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 19 Jul 2018, 03:23 PM
Hello Paolo,

The control does have a built-in mechanism for limiting the count of its items. Although I am not familiar with your setup, you should be able to achieve your goal by checking the Count of the Items collection of the control and avoid adding more elements when it reaches the required value. As to the elements not filling the entire space, such appearance would be the expected one if the elements have fixed values for their Width/Height properties. Can you please check whether this is not the case in your setup as well?

Regards,
Stefan
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
paolo
Top achievements
Rank 1
answered on 25 Jul 2018, 01:27 PM

Hello,

Sorry for my delay, on the limiting max item I've set row and column number max to 3/2 and I've removed my "by-code" check...can you please provide me a sample where is taken is automatically stretched? I've tested on my side and I got no height/width assigned

Thanks

0
Stefan
Telerik team
answered on 27 Jul 2018, 02:35 PM
Hello Paolo,

Attached to my reply you can find a sample application that demonstrates how the elements within RadLayoutControl automatically fill the available space. Clicking the Button would add an additional item and again, all items will fill the available space unless they have fixed values for the Width/Height properties. Can you please take a look at it?

I hope this helps.

Regards,
Stefan
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
paolo
Top achievements
Rank 1
answered on 15 Aug 2018, 02:25 PM

Hello Stefan,

Sorry for my delay in response but I was on vacation and my wife forced me to stay away from PC! btw ypur example works really fine.. I was wondering if there's a way I can achieve this functionality :

I need to show the latest 6 views based on a series of fired event, if I've 6 opened event and another one arrives, I've to show the latest one arrived and remove the oldest one. It's possible to have some kind of stack or to minimize the oldest and show in the screen just the newest 6?

0
Stefan
Telerik team
answered on 16 Aug 2018, 10:08 AM
Hi Paolo,

In case I am understanding your requirement correctly, you should be able to manipulate the Items collection of the control by adding/removing items so that it serves your needs. Does this correspond to your needs?

Regards,
Stefan
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
LayoutControl
Asked by
paolo
Top achievements
Rank 1
Answers by
Stefan
Telerik team
paolo
Top achievements
Rank 1
Share this question
or