ListControl in Custom Cell width and height 100%

6 posts, 0 answers
  1. André
    André avatar
    1 posts
    Member since:
    May 2016

    Posted 24 May Link to this post

    Hello,

    i created a custom cell element.

    The custom part of the Element is a RadListControl.

    The functionality works but I want the ListControl Element fit perfect in the Cell.

    I have tried a lot and read many forum threads to find a solution but nothing works.

    There are still Gaps (see Screenshot).

    I hope someone can help me quick with my request.

    Greets André

     

  2. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 25 May Link to this post

    Hi Andre,

    Thank you for writing.

    You can use RadListElement instead. For example:
    class MyGridDataCellElement : GridDataCellElement
    {
        public MyGridDataCellElement(GridViewColumn column, GridRowElement row) : base(column, row)
        { }
        protected override void CreateChildElements()
        {
            base.CreateChildElements();
            RadListElement list = new RadListElement();
            for (int i = 0; i < 3; i++)
            {
                list.Items.Add(new RadListDataItem("item " + i));
            }
            this.Children.Add(list);
     
        }
    }

    Another example for this is available here: Creating custom cells.

    Let me know if I can assist you further.

    Regards,
    Dimitar
    Telerik
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Ahmed
    Ahmed avatar
    1 posts
    Member since:
    May 2016

    Posted 30 May in reply to Dimitar Link to this post

    Dear Dimitar,

    is there is a way to change the dropdownlist items.

    for example i need each dropdownlist contains different items based on its row id value

    Regards,

    Ahmed

  5. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 31 May Link to this post

    Hi Andre,

    Thank you for writing back.

    You can override the SetContentCore method and set the items there:
    protected override void SetContentCore(object value)
    {
        base.SetContentCore(value);
        var rowId = (int) this.RowInfo.Cells[0].Value;
     
        list.Items.Clear();
        for (int i = 0; i < rowId/10; i++)
        {
            list.Items.Add(new RadListDataItem("item " + i));
        }
    }
     
    I hope this will be useful. 

    Regards,
    Dimitar
    Telerik
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  6. Gopinath
    Gopinath avatar
    1 posts
    Member since:
    Sep 2011

    Posted 21 Jun Link to this post

    HI

    Thanks in advance.

    I need help in gridview, i have to create a date control and combo in a different cell in the same column.

    pl can u send me a small project using radgridview and create the above.

    Regards

    Gopinath

     

     

     

     

  7. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 21 Jun Link to this post

    Date: 6/21/2016 4:52:40 AM
    Hello Gopinath,

    Thank you for writing.

    If I understand correctly you want to show different editors in the same column. The following article shows how this can be achieved: Change the active editor depending on the cell value type. | UI for WinForms Documentation

    I hope this will be useful. 

    Regards,
    Dimitar
    Telerik
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Back to Top
UI for WinForms is Visual Studio 2017 Ready