How to reproduce: Bind RadCardView to the Employees table from the Northwind database:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.radCardView1.CardViewItemCreating += radCardView1_CardViewItemCreating;
}
private void radCardView1_CardViewItemCreating(object sender, Telerik.WinControls.UI.CardViewItemCreatingEventArgs e)
{
CardViewGroupItem group = e.NewItem as CardViewGroupItem;
if (group != null)
{
group.IsExpanded = false;
}
}
private void Form1_Load(object sender, EventArgs e)
{
this.employeesTableAdapter.Fill(this.nwindDataSet.Employees);
}
}
Workaround: handle the CardViewItemFormatting event
private void radCardView1_CardViewItemFormatting(object sender, CardViewItemFormattingEventArgs e)
{
CardViewGroupItem group = e.Item as CardViewGroupItem;
if (group != null && group.Tag == null && group.Parent != null && group.Parent.Parent != null && group.Parent.Parent is CardListViewVisualItem)
{
group.IsExpanded = false;
group.Tag = "Processed";
}
}