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. Image for the cookie policy date

ToolTipText for GridControl

Hi, I am using Syncfusion Custom Control derived from gridControl. Q1: How do i set tooltip text ..? Q2: How do i identify which column it is..? Q3: ToolTipText should be what is present in corresponding cell.

4 Replies

AD Administrator Syncfusion Team June 23, 2005 04:34 AM

You set the style.ToolTipText for the particular cell. You can do this in QueryCellInfo.
private void grid_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
	if(e.RowIndex > 0 && e.ColIndex > 0)
	{
		e.Style.CellTipText = e.Style.FormattedText;//maybe .Text or some other string...
	}
}


AS Anna Srinivasan June 23, 2005 04:43 AM

Hi, I need to set the tool tip at runtime when the user moves the mouse over each cell of the grid. The Text value of the cell should be set as tool tip for the corresponding cell. Thanks, Anna


AD Administrator Syncfusion Team June 23, 2005 06:25 AM

Try it in PrepareViewStyleInfo. This worked for me.
private void Form1_Load(object sender, System.EventArgs e)
{
	this.gridControl1[1,1].Text = "SomeText in Cell 1,1";
	this.gridControl1[2,1].Text = "SomeText in Cell 2,1";
	this.gridControl1[1,2].Text = "SomeText in Cell 1,2";
	this.gridControl1[2,2].Text = "SomeText in Cell 2,2";
	this.gridControl1.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(gridControl1_PrepareViewStyleInfo);
}

private void gridControl1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
	if(e.ColIndex > 0 && e.RowIndex > 0)
	{
		e.Style.CellTipText = e.Style.Text;
	}
}


AS Anna Srinivasan June 23, 2005 07:00 AM

Thanks a lot.

Loader.
Live Chat Icon For mobile
Up arrow icon