Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cell padding

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
morgenweck



Joined: 09 Jun 2010
Posts: 21

PostPosted: Sat Jun 12, 2010 2:33 am    Post subject: Cell padding Reply with quote

Is there a way to set the cell padding? If I set the autoheight to true. wordwrap to true and put a border aroung the cell then the top line of multi text appears right on the border. Do I need to use a custom editor?
I using object binding

Thanks
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sat Jun 12, 2010 4:22 am    Post subject: Reply with quote

Do you mean the padding around the text when there is an active editor like a textbox (ie you can change the text) or the padding around text in a normal display cell?
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
morgenweck



Joined: 09 Jun 2010
Posts: 21

PostPosted: Sat Jun 12, 2010 1:38 pm    Post subject: Reply with quote

I'm using multi line text in a standard cell with no editor.

Dim Research As ResearchObjectInfo = CType(e.Row.Item, ResearchObjectInfo)

e.CellData.Value = Research.Name
e.CellData.OddStyle.BorderColor = Color.Black
e.CellData.OddStyle.BorderWidth = 1
e.CellData.OddStyle.BackColor = Color.WhiteSmoke
e.CellData.OddStyle.BorderRadius = 5
e.CellData.OddStyle.BorderStyle = Border3DStyle.Flat
e.CellData.OddStyle.WordWrap = True

I hopes that this helps.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Jun 14, 2010 12:53 am    Post subject: Reply with quote

Virtual Tree doesn't currently have a separate text padding option - however this is something we could look at for the next version. To change the padding around the text you would need to create a custom CellWidget (see the section in help on using Widgets) and override the PaintText method as shown below which adds a padding of 5 around the text vertically and horizontally. You also need to override the GetOptimalHeight and GetOptimalWidth methods as shown to adjust for the extra padding.

Code:
    public class MyCellWidget : CellWidget
    {
        public MyCellWidget(RowWidget rowWidget, Column column)
            : base(rowWidget,column)
        {
        }

        protected override void PaintText(Graphics graphics, Rectangle bounds, Style style, string text, bool printing)
        {
            bounds.Inflate(-5, -5);
            base.PaintText(graphics, bounds, style, text, printing);
        }

        public override int GetOptimalWidth(Graphics graphics)
        {
            return base.GetOptimalWidth(graphics) + 10;
        }

        public override int GetOptimalHeight(Graphics graphics, int width)
        {
            return base.GetOptimalHeight(graphics, width) + 10;
        }

    }

_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group