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

Text Alignment in RadPanel

6 Answers 302 Views
Panel
This is a migrated thread and some comments may be shown as answers.
Chris Kirkman
Top achievements
Rank 1
Chris Kirkman asked on 30 Mar 2010, 02:38 PM
Is there a simple way to set the alignment of text added to this panel to be at the top left?  It defaults to center left.

6 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 02 Apr 2010, 09:26 AM
Hello Chris Kirkman,

Thank you for your question.

You should select RadPanel's Smart Tag, trigger the "Edit UI Elements" command, locate the child TextPrimitive and apply the desired value to the TextAlignment property (see the attached screenshot ).

Another option is to add this line in form's load event:

this.radPanel1.PanelElement.PanelText.TextAlignment = ContentAlignment.TopCenter;

I hope this helps. Do not hesitate to contact us if you have other questions.

Kind regards,
Peter
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Chris Kirkman
Top achievements
Rank 1
answered on 02 Apr 2010, 03:51 PM
I was optimistic; however neither method worked.

The first and preferred method DOES change the setting in the "Edit UI Elements" dialog; however at runtime there is no difference whatsoever.  The text is still centered.

The 2nd method doesn't exist as a property.  From my Panel.PanelElement I can find no "PanelText" property. 

I'm using the demo version of your latest control set.
0
Chris Kirkman
Top achievements
Rank 1
answered on 02 Apr 2010, 04:06 PM
I came up with a method that works...

Declare a member variable...

        TextPrimitive m_text = null;

In the constructor...

 TextStyle.TextAlignment = ContentAlignment.TopCenter;

In the class...

        private TextPrimitive TextStyle
        {
            get
            {
                if (null == m_text)
                {
                    foreach (RadElement element in m_pnl.PanelElement.Children)
                    {
                        if (element.GetType() == typeof(TextPrimitive))
                        {
                            m_text = (TextPrimitive)element;
                            break;
                        }
                    }                   
                }

                return m_text;
            }
        }

0
Peter
Telerik team
answered on 07 Apr 2010, 09:54 AM
Hello Chris Kirkman,

Please, excuse us for the inconvenience. Yes, we introduced this property in Q1 2010 and  I am happy that you managed to find a solution for your case.
 
Don't hesitate to contact us if you have other questions.

Kind regards,
Peter
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Srinivas
Top achievements
Rank 1
answered on 11 Jul 2016, 02:27 PM

i am using windows forms UI and using split container to keep controls based on the requirement, i have hide and show them in c#.

The problem is if i hide control, that place is reserving as a empty space, once it is hidden, the other controls needs to move up.

if you see the attached screen you will understand it.  is there any property to set like visibility: collapsed.

 

thanks in advance.

0
Hristo
Telerik team
answered on 12 Jul 2016, 11:29 AM
Hi Srinivas,

Thank you for writing.

You can set the Dock property of the controls located in the split panel to Top. This way when you hide the upper control the one underneath will take its location.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik by Progress
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.
Tags
Panel
Asked by
Chris Kirkman
Top achievements
Rank 1
Answers by
Peter
Telerik team
Chris Kirkman
Top achievements
Rank 1
Srinivas
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or