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.

tool tip for a record

Thread ID:

Created:

Updated:

Platform:

Replies:

32196 Jul 25,2005 05:47 AM Jul 25,2005 08:39 AM Windows Forms 8
loading
Tags: GridControl
Catinat Velmourougan
Asked On July 25, 2005 05:47 AM

hi I need to display a tool tip for a record whenever the mouse hovers above it.How to achieve this? regards, Catinat

Administrator [Syncfusion]
Replied On July 25, 2005 06:07 AM

Handle the PrepareViewStyleInfo the value of e.RowIndex.

Catinat Velmourougan
Replied On July 25, 2005 06:23 AM

hi , Your reply is unclear to me. I have gone searched through your KB, Forums and samples and found only tool tip texts for a cell. The requirement is for current row. Can you explain in more detail? regards, Catinat

Catinat Velmourougan
Replied On July 25, 2005 06:36 AM

hi Heres the code which I think will throw up more insight into my problem, In my mouse hover event I have written this code : Record record = this.GroupingGrid.SyncfusionGridControl.Table.CurrentRecord; string col1 = Convert.ToString(record.GetValue("COL1")); string col2 = Convert.ToString(record.GetValue("COL2")); string toolTipText = col1 + col2; How to set this toolTiptext to the current row?

Administrator [Syncfusion]
Replied On July 25, 2005 06:38 AM

1) Subscribe to the grid.PrepareViewStyleInfo event. 2) In your handler, set the e.Style.CellTipText property based on e.RowIndex.
private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
	if(e.ColIndex > 0 && e.RowIndex > 0)
	{
		e.Style .CellTipText = string.Format("Tip for row {0}. Cell value={1}", e.RowIndex, this.gridDataBoundGrid1[e.RowIndex, e.ColIndex].CellValue);
	}
}

http://www.syncfusion.com/Support/user/uploads/GDBG_ToolTip_c30e09f6.zip

Administrator [Syncfusion]
Replied On July 25, 2005 06:47 AM

You did not mention you were using a GridGroupingControl. Instead of PrepareViewStyleInfo, in a GridGroupingControl, you should use the QueryCellStyleInfo event to set the tip.
private void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
	if(e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell
		|| e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell)
	{
		GridRecordRow rec = e.TableCellIdentity.DisplayElement as GridRecordRow;
		if(rec.ParentRecord != null)
		{
			e.Style.CellTipText = rec.ParentRecord.GetValue("Col1") + "  " + rec.ParentRecord.GetValue("Col2");
		}
	}
}

Catinat Velmourougan
Replied On July 25, 2005 06:49 AM

hi, I havent yet tried what you said. I feel it may not work. Will the following conditions prevent the above solution from working? Its grouping grid. I dont know the index of cols, only names. These cols are not visible cols.

Administrator [Syncfusion]
Replied On July 25, 2005 07:39 AM

The code I posted for QueryCellStyleInfo above was copied it from a working sample. Try it. http://www.syncfusion.com/Support/user/uploads/GDBG_ToolTip_44ab7f50.zip

Catinat Velmourougan
Replied On July 25, 2005 08:39 AM

Its working fine. Thanks Regards, Catinat

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.

;