Usage of UniformGrid

4 posts, 0 answers
  1. vijay
    vijay avatar
    10 posts
    Member since:
    Aug 2011

    Posted 31 Jul 2015 Link to this post

    Hi,

    It seems that UniformGrid is available in Telerik UI for Winforms. But, I could not find any documentation which can help me in using it.

    I added the Telerik.WinControls.dll which seems to be having the UniformGrid control but I could not find it in the Toolbox.

    Could you provide the documentation on how to use it?

     Regards,

    vijay

  2. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 31 Jul 2015 Link to this post

    Hello Vijay,

    Thank you for writing.
     
    Telerik UI for WinForms suite offers only RadGridView. You can refer to the online documentation on the following link: http://www.telerik.com/help/winforms/gridview-overview.html. However, you can use RadLayoutControl which allows you to add and arrange other controls in complex layouts. If it is not applicable for your case, could you please specify what is the exact requirement that you are trying to achieve? Thus, we would be able to think about a suitable solution and assist you further. Thank you in advance.

    I hope this information helps. Should you have further questions, I would be glad to help.
     
    Regards,
    Dess
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
  4. vijay
    vijay avatar
    10 posts
    Member since:
    Aug 2011

    Posted 31 Jul 2015 in reply to Dess Link to this post

    Hi,

    But, UniformGrid class seems to be available in Telerik.WinControls.dll.

    Can i not use it?

    Regards,

    vijay

  5. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 31 Jul 2015 Link to this post

    Hello Vijay,

    Thank you for writing back.
     
    Telerik.WinControls.Layouts.UniformGrid is a LayoutPanel derivative that is supposed to arrange content in a grid with cells in same size. You can find information about the Predefined Layout Panels in the referred help article. However, the UniformGrid is missing there. We will consider improvement of the documentation. The approach for using it is similar as the other layout panels. Here is an example:
    public Form1()
    {
        InitializeComponent();
     
        MyUniformGridControl c = new MyUniformGridControl();
        c.AutoSize = true;
        c.BackColor = Color.Red;
        this.Controls.Add(c);
    }
     
    public class MyUniformGridControl : RadControl
    {
        protected override void CreateChildItems(RadElement parent)
        {
            base.CreateChildItems(parent);
            parent.Children.Add(new MyGridLayoutPanelElement());
        }
    }
     
    class MyGridLayoutPanelElement : RadElement
    {
        Telerik.WinControls.Layouts.UniformGrid layoutPanel;
     
        protected override void CreateChildElements()
        {
            layoutPanel = new Telerik.WinControls.Layouts.UniformGrid();
            layoutPanel.StretchHorizontally = layoutPanel.StretchVertically = false;
     
            layoutPanel.Columns = 4;
            layoutPanel.Rows = 10;
            Size boxSize = new Size(16, 16);
            for (int i = 0; i < layoutPanel.Columns * layoutPanel.Rows; i++)
            {
                LightVisualElement box = new LightVisualElement();
                box.DrawBorder = true;
                box.BorderGradientStyle = GradientStyles.Solid;
                box.BorderBoxStyle = BorderBoxStyle.OuterInnerBorders;
                box.MaxSize = boxSize;
                box.MinSize = boxSize;
                box.NotifyParentOnMouseInput = true;
                layoutPanel.Children.Add(box);
            }
     
            this.Children.Add(layoutPanel);
            base.CreateChildElements();
        }
     
        private RadElement GetTextBoxElement(int count)
        {
            RadButtonElement result = new RadButtonElement();
            result.ShowBorder = true;
            result.Text = "Button" + count.ToString();
            result.StretchHorizontally = true;
            result.StretchVertically = true;
            return result;
        }
    }

    It is necessary to add the following references in your project: Telerik.WinControls, Telerik.WinControls.UI, TelerikCommon.

    I hope this information helps. If you have any additional questions, please let me know.

    Regards,
    Dess
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top