We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

GridGroupingControl - Right Aligning Cell Background Image

Thread ID:

Created:

Updated:

Platform:

Replies:

45760 Jun 28,2006 06:22 AM Jun 28,2006 12:13 PM Windows Forms 1
loading
Tags: GridControl
Badri Rajani Kanth
Asked On June 28, 2006 06:22 AM

Dear Syncfusion, We are working with Syncfusion 3.2.1.0 GridGroupingControl. In some cells, we want to display text as left/center aligned and image(icon) as right aligned. We are handling _QueryCellStyleInfo event with the below given code. e.Style.BackgroundImageMode = GridBackgroundImageMode.Normal; e.Style.BackgroundImage = Image///loaded from library e.Style.Text = cellText; e.Style.TextAlign = GridTextAlign.Left; But we see the image also left aligned and text starting after image..We could not find Right aligning option for image.. Can you please help? Rgds Rajani Kanth Badri

Administrator [Syncfusion]
Replied On June 28, 2006 12:13 PM

Hi Rajani, To draw the Image with Right align in a textbox cell, You need to handle the TableControlDrawCell event. Here is a code snippet. if(e.Inner.RowIndex > 0 && e.Inner.ColIndex == 2) { Point pt = new Point(e.Inner.Bounds.X + e.Inner.Bounds.Width - img.Size.Width , e.Inner.Bounds.Y ); Rectangle RightRect = new Rectangle( pt,img.Size); e.Inner.Renderer.Draw(e.Inner.Graphics,e.Inner.Bounds,e.Inner.RowIndex,e.Inner.ColIndex,e.Inner.Style); e.Inner.Graphics.DrawImage(img,RightRect); e.Inner.Cancel = true; } } Here is a sample. http://www.syncfusion.com/Support/user/uploads/ImageTextBoxwithAlignment_626e184f.zip Let me know if this helps. Best Regards, Haneef

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;