Thanks, with your example I've could achieve my needs.There is another thing, this listview meant to be a notification center, and to make this wonderfull I'm trying to do an "autosize" function, since there is no autosize property, how can I increase the height of this listview as more notification appears, setting the max height of the PoopupContainer as the Screen.WorkingArea.Height - PoopupContainer.StartPosition.Y. (And I don't know if these are the real properties)
Note that if you set the AllowArbitraryItemHeight property to true, this will size the items according to the size each item needs to fit the available content. If you need to enlarge the RadListView control when adding items at run time, you can iterate the Items collection and sum the total height of all items. Then, if the calculated height exceeds the screen height,limit the height to the screen height. Otherwise, use the calculated height. You can find below a sample code snippet which illustrates the idea:
BindingList<notificacao_model> items = new BindingList<notificacao_model>();
this.radListView1.VisualItemCreating += radListView1_VisualItemCreating;
for (int i = 0; i < 10; i++)
items.Add(new notificacao_model(i % 2 == 0,i % 2 == 0, string.Concat(Enumerable.Repeat("Title" + i, 2)),"Description" + i, i % 2 == 0,i % 2 == 0));
this.radListView1.DataSource = items;
this.radListView1.AllowArbitraryItemHeight = true;
this.radListView1.Items.CollectionChanged += Items_CollectionChanged;
privatevoidItems_CollectionChanged(object sender, Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)
int totalHeight = 0;
foreach (ListViewDataItem item inthis.radListView1.Items)
totalHeight += item.ActualSize.Height;
Size screenSize = new Size(Screen.AllScreens[Screen.AllScreens.Length - 1].Bounds.Width * Screen.AllScreens.Length,
this.radListView1.Size = new Size(this.radListView1.Width,Math.Min(totalHeight+20, screenSize.Height-50) );
Should you have further questions please let me know.
Dess | Tech Support Engineer, Sr.
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.