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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How can I add a column in ggc that this colum contains Textbox in the left and a Picture in the right

Thread ID:





70612 Dec 19,2007 09:32 AM UTC Dec 27,2007 05:35 PM UTC WinForms 3
Tags: Grouping
Asked On December 19, 2007 09:32 AM UTC

How can I add a column in ggc that this colum contains Textbox in the left and a Picture in the right.
If I click the right side picture I also want to rise a event which I can put my code in to change the text in the left side textbox?


Administrator [Syncfusion]
Replied On December 19, 2007 01:40 PM UTC

One way you can do it is to handle the TableControlCellDrawn event and draw the image yourself. Here is a little sample showing some details.


Replied On December 24, 2007 07:04 AM UTC

Thanks,but I have another problem,I want to click the image to fire a event.How can I do this?

haneefm [Syncfusion]
Replied On December 27, 2007 05:35 PM UTC

Hi Strife,

One way you can do this by handling the TableControlCellClick event of the grid and fire the Image clicked event. Below are the codes that shows this task.

void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex);
if (style.TableCellIdentity.Column != null
&& style.TableCellIdentity.Column.Name == "Col2"
&& style.TableCellIdentity.DisplayElement.GetRecord() is GridRecord)

GridTextBoxCellRenderer cr = e.TableControl.CellRenderers["TextBox"] as GridTextBoxCellRenderer;
Rectangle Cellrect = cr.GetCellClientRectangle(e.Inner.RowIndex, e.Inner.ColIndex, style, false);

Rectangle imgRect = new Rectangle(Cellrect.X + Cellrect.Width - style.TextMargins.Right, Cellrect.Y , style.TextMargins.Right, Cellrect.Height);
bool b = imgRect.IntersectsWith(new Rectangle(e.Inner.MouseEventArgs.Location, new Size(1, 1)));
if (b)
MessageBox.Show("Image Clicked....");


Best regards,


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon