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.

Images and Text in the same column in Grouping Grid Control

Thread ID:

Created:

Updated:

Platform:

Replies:

68645 Sep 26,2007 04:47 AM Dec 26,2007 06:39 AM Windows Forms 4
loading
Tags: Grouping
Venkat Akella
Asked On September 26, 2007 04:47 AM

hi,

I have to put image and text in the same column of the grid grouping control. Can you guys suggest any approach.

Golda Rebecal [Syncfusion]
Replied On October 1, 2007 10:16 PM

Hi Venkat,

I regret for the long delay in responding.

You can achieve this requirement by handling the QueryCellStyleInfo to set the image index to the required cells of a particular column based on the cellvalue and TabeControlDrawCellDisplayText event to cancel the drawing of text in those cells.

Please refer to the attached sample that illustrates the same:
http://websamples.syncfusion.com/samples/Grid.Windows/F68645/main.htm

Kindly let me know if this helps you.

We appreciate your interest in Syncfusion products.

Best regards,
Golda

Venkat Akella
Replied On October 23, 2007 11:37 AM

Actually i want to have image and Text in same column of the grid grouping control. Can you suggest how can i achieve this?

Venkat Akella
Replied On October 23, 2007 11:38 AM

i want have image and text in same column cell of the Grid Grouping control. can you suggest an approach?

Jeba S [Syncfusion]
Replied On December 26, 2007 06:39 AM

Hi Venkat,

Sorry for the delay in response.

Another way to achieve images and text in the same column in GroupingGridControl by handling the TableControlCellDrawn. In this event handler using the DrawImage method you can draw the image in the column that contains text.

Below is the code snippets:

private void gridGroupingControl1_TableControlCellDrawn(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlDrawCellEventArgs e)
{
GridTableCellStyleInfo style = (GridTableCellStyleInfo)e.Inner.Style;
Rectangle iconBounds;
if (style.TableCellIdentity.ColIndex == 1 && style.TableCellIdentity.RowIndex >=4 )
{
iconBounds = Rectangle.FromLTRB(e.Inner.Bounds.Right - 18, e.Inner.Bounds.Top, e.Inner.Bounds.Right, e.Inner.Bounds.Bottom);
GridStaticCellRenderer.DrawImage(e.Inner.Graphics, this.images, 1, iconBounds, false);
e.Inner.Cancel = true;
}
}



Please refer the sample which illustrates the above said feature:
http://websamples.syncfusion.com/samples/Grid.Windows/F68645Second/main.htm

Kindly let us know if you need any further assistance.

Best Regards,
Jeba.





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.

;