Adding controls Dynamically

4 posts, 0 answers
  1. Velkumar
    Velkumar avatar
    16 posts
    Member since:
    Jul 2012

    Posted 07 Aug 2012 Link to this post


    How to add controls (Check box, text box) dynamically to listview
  2. Ivan Petrov
    Ivan Petrov avatar
    701 posts

    Posted 09 Aug 2012 Link to this post

    Hello Velkumar,

    Thank you for writing.

    You can see an example on how to add elements to a ListViewItem in our online documentation. List view items have build in check boxes, you can read more on how to use them again in our documentation.

    I hope this will be useful. Should you have further questions, I would be glad to help.
    Ivan Petrov
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  3. DevCraft R3 2016 release webinar banner
  4. Seshu
    Seshu avatar
    3 posts
    Member since:
    Nov 2012

    Posted 26 Jan 2015 in reply to Ivan Petrov Link to this post

    Can you add dropdown list to list view as one column? How do you do that?

    Thank you
  5. Dess
    Dess avatar
    1561 posts

    Posted 29 Jan 2015 Link to this post

    Hello Seshu,

    Thank you for contacting us.

    If I understand your requirement correctly, you are trying to display drop down list for a specific column. For this purpose, you can use a custom DetailListViewDataCellElement and override the CreateChildElements where you can add a RadDropDownListElement to the Children collection. The result from the following code snippet is illustrated on the attached screenshot:
    private void radListView1_CellCreating(object sender, ListViewCellElementCreatingEventArgs e)
        DetailListViewDataCellElement cell = e.CellElement as DetailListViewDataCellElement;
        if (cell != null && cell.Data.Name == "Title")
            e.CellElement = new CustomDetailListViewDataCellElement(cell.RowElement, e.CellElement.Data);

    public class CustomDetailListViewDataCellElement : DetailListViewDataCellElement
        private RadDropDownListElement dropdown;
        public CustomDetailListViewDataCellElement(DetailListViewVisualItem owner,
            ListViewDetailColumn column) : base(owner, column)
        protected override void CreateChildElements()
            this.dropdown = new RadDropDownListElement();
            this.dropdown.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
            this.dropdown.DataSource = new List<string>() { "one", "two", "three" };
        protected override Type ThemeEffectiveType
                return typeof(DetailListViewHeaderCellElement);
        public override void Synchronize()
            this.Text = "";

    Note that RadDropDownListElement hosts the MS TextBox if the DropDownStyle property is set to DropDown. Using controls in RadListView cells may slow down the scrolling and will cause visual glitches as they do not support clipping. A better option would be using custom editors. Please refer to ListView >> Checkboxes and editors help article >> Switching Editors section.

    I hope this information helps. Should you have further questions, I would be glad to help.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top