How to give tooltip to cells of a column in GGC

Hi

I need to give tool tip for all the cells of 2 columns. The tooltip text is same as column/cell text . I tried many options for the same. It would be helpful if I get some sample code.

Thanks,

Varsha

 


1 Reply

YO Yogeshwaran Syncfusion Team September 4, 2012 06:12 AM UTC

Hi Varsha,

 

Thanks for using Syncfusion products.

 

Your requirement to assign tool tip to particular column can be achieved by using QueryCellStyleInfo. Please refer the following code snippet.

 

this.GridGroupingControl1.QueryCellStyleInfo += new GridTableCellStyleInfoEventHandler(GridGroupingControl1_QueryCellStyleInfo);

 

 

void GridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)

        {

            if (e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell || e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell)

            {

                if (e.TableCellIdentity.Column.MappingName == "Name" || e.TableCellIdentity.Column.MappingName == "Currency")

                {

                    e.Style.CellTipText = e.Style.Text;//Assign cell value to tool tip

                }

            }

        }

 

 

 

For your convenience , we have created the sample and same can be downloaded from below link.

 

tooltip.zip

 

Please let us know if you have any concerns.

 

Regards,

Yogesh R


Loader.
Up arrow icon