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

Rounded Selection

2 Answers 67 Views
ListControl
This is a migrated thread and some comments may be shown as answers.
Andre
Top achievements
Rank 1
Andre asked on 24 Jan 2013, 04:30 AM
How would i add rounded corners to the highlighted item similar to "recent projects" in the visual studio start page?

http://www.telerik.com/community/forums/winforms/dropdownlist-and-listcontrol/dropdownlist-shape-roundrect-c.aspx

I've read the following post, but i can't seem to figure out how to change the selection, rather than the control

Thanks

2 Answers, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 28 Jan 2013, 03:12 PM
Hello Andre,

Thank you for contacting us.

You can use the VisualItemFormatting event to apply shape to all visual items. The following code sample demonstrates this:
public Form1()
{
    InitializeComponent();
 
    this.radListControl1.VisualItemFormatting += new Telerik.WinControls.UI.VisualListItemFormattingEventHandler(radListControl1_VisualItemFormatting);
 
    for (int i = 0; i < 30; i++)
    {
        this.radListControl1.Items.Add("Item " + i);
    }
}
 
void radListControl1_VisualItemFormatting(object sender, Telerik.WinControls.UI.VisualItemFormattingEventArgs args)
{
    args.VisualItem.Shape = new RoundRectShape(3);
}

Hope you find this useful. If you have any other questions, do not hesitate to ask.

Greetings,
Ivan Todorov
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
0
Andre
Top achievements
Rank 1
answered on 28 Jan 2013, 03:48 PM
This is great, thanks for your help.
Tags
ListControl
Asked by
Andre
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Andre
Top achievements
Rank 1
Share this question
or