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.

GridControl with SuperToolTip

Thread ID:

Created:

Updated:

Platform:

Replies:

54051 Dec 28,2006 08:11 AM Feb 7,2007 12:35 AM Windows Forms 12
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On December 28, 2006 08:11 AM

Is it possible to attach a SuperToolTip to each cell in GridControl?

Administrator [Syncfusion]
Replied On December 28, 2006 11:04 PM

Hi Ichiro,

Try setting the Style.CellTipText property to display the tooltip in a cell.

//PrepareViewStyleInfo event.
e.Style.CellTipText = e.Inner.Style.Text;

Please refer the below forum threads for more details.
For Tooltip properties : http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=29799
For Tooltip Size : http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=23741
For Tooltip Width : http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=12940
Tooltip for largetext : http://www.syncfusion.com/support/forums/message.aspx?MessageID=52262

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On December 29, 2006 03:47 AM

Hi, Haneef.
Thank you for your reply.

Yes, I can display a normal tooltip in a cell by using GridStyleInfo.CellTipText property:

gridControl1[2,3].CellTipText = "hello.";

However, my customer require the tooltip to include some pictures. I found that SuperToolTip is a tooltip with the functionality to include pictures, so I tried to bind a cell to a SuperToolTip, but failed.

Is it possible? Or is there another way to display tooltip with pictures in a cell of GridControl?

>Hi Ichiro,

Try setting the Style.CellTipText property to display the tooltip in a cell.

//PrepareViewStyleInfo event.
e.Style.CellTipText = e.Inner.Style.Text;

Please refer the below forum threads for more details.
For Tooltip properties : http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=29799
For Tooltip Size : http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=23741
For Tooltip Width : http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=12940
Tooltip for largetext : http://www.syncfusion.com/support/forums/message.aspx?MessageID=52262

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On January 4, 2007 06:41 AM

Hi Ichiro,

My apologies for the delay in response.

You need to handle the ActivateToolTip event of the grid and show the superTooltip using SuperToolTip.Show method. Here is a code snippet to show this.

//Form Load event .....
sToolTip = new SuperToolTip(this);

//Activate tooltip event.
private SuperToolTip sToolTip ;
void gridDataBoundGrid1_ActivateToolTip(object sender, GridActivateToolTipEventArgs e)
{
e.Cancel = true;
ToolTipInfo tipInfo = new ToolTipInfo();
tipInfo.BackColor = Color.Red;
tipInfo.Body.Image = SystemIcons.Information.ToBitmap();
tipInfo.Body.Text = e.Style.CellTipText +":::" + e.Style.Text ;
sToolTip.Show(tipInfo, MousePosition);
}

void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{ e.Style.CellTipText = "ToolTip Text"; } //CellTipText is used to fire the Activate ToolTip event of the grid cell.

Please refer to the attached sample for more details.
GDBGSuperTooltip.zip

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On January 8, 2007 10:08 PM

Hi, Haneef.

According to your advice, I can use SuperToolTip on each cell of GridControl.
Thank you so much!

Administrator [Syncfusion]
Replied On January 31, 2007 09:06 PM

Well, I have one more question.

Currently I can see SuperToolTip to the right of the cursor:

int toolTipX = MousePosition.X + 15;
int toolTipY = MousePosition.Y;
superToolTip.Show(_tipInfo, new System.Drawing.Point(toolTipX, toolTipY), 5000);

But I cannot see the SuperToolTip when the cursor is at the right edge of the monitor screen.
I would like the SuperToolTip to be seen even when the cursor is at the right of the screen.
For example, is it possible to have the SuperToolTip on the left side of the cursor, when the cursor is at the right most of the screen?
I would like to know how to implement this.

Thank you for your time.
I am looking forward to hearing from you soon.

Administrator [Syncfusion]
Replied On February 1, 2007 01:17 PM

Hi Ichiro,

I have modified the sample as per your requirement. Please try the attached sample and let me know if you are looking something different.

sample : ModifiedGDBGSuperTooltip.zip

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On February 5, 2007 03:42 AM

Hi Haneef,

Thank you for your reply.
I think you have understood the problem correctly.
However, I was wondering if it is possible to have the SuperToolTip just next to the cursor,
and _not_ to the far left as in the modified version you have sent to me.

SuperToolTip0.zip

Administrator [Syncfusion]
Replied On February 5, 2007 03:46 AM

I sent the message above this.
I just forgot to write my name...

Administrator [Syncfusion]
Replied On February 5, 2007 03:18 PM

Hi Ichiro,

Thanks for your update.

You can handle the ActivateToolTip event of the grid and call superTooltip.Show method to display the tooltip at required position. Here is a code snippet.

private SuperToolTip sToolTip ;
void gridDataBoundGrid1_ActivateToolTip(object sender, GridActivateToolTipEventArgs e)
{
e.Cancel = true;
ToolTipInfo tipInfo = new ToolTipInfo();
tipInfo.BackColor = Color.Red;
tipInfo.Body.Image = SystemIcons.Information.ToBitmap();
tipInfo.Body.Text = e.Style.CellTipText +":::" + e.Style.Text ;
sToolTip.MaxWidth = 150;

// sToolTip.MaxWidth(150) + 15(scroll bar width) = 165;
if (MousePosition.X + 165 < this.Location.X + this.gridDataBoundGrid1.Size.Width)
{
sToolTip.Show(tipInfo, new Point(MousePosition.X + 15, MousePosition.Y));
}
else
{
Point pt = new Point(MousePosition.X - 165, MousePosition.Y);
sToolTip.Show(tipInfo, pt);
}
}

Please refer to the attached sample for modification.
ModifiedGDBGSuperTooltip.zip

Best regards,
Haneef

Administrator [Syncfusion]
Replied On February 6, 2007 06:10 AM

Hi Haneef,

Thank you for your reply.

Well, I would like the position of the superTooltip to look a little more natural.
You handled MaxWidth property of SuperToolTip in the code above, but it doesn't seem to be the actual width of the superTooltip displayed by superTooltip.Show() method.
I would like to get the actual width of the superTooltip, to display just next to the cursor.
To get to the point, I want to do the followng:

private SuperToolTip sToolTip ;
void gridDataBoundGrid1_ActivateToolTip(object sender, GridActivateToolTipEventArgs e)
{
e.Cancel = true;
ToolTipInfo tipInfo = new ToolTipInfo();
tipInfo.BackColor = Color.Red;
tipInfo.Body.Image = SystemIcons.Information.ToBitmap();
tipInfo.Body.Text = e.Style.CellTipText +":::" + e.Style.Text ;

int tipWidth = sToolTip.GetActualWidth(tipInfo); // Get actual width of sToolTip displayed

if (MousePosition.X + tipWidth < this.Location.X + this.gridDataBoundGrid1.Size.Width)
{
sToolTip.Show(tipInfo, new Point(MousePosition.X + 15, MousePosition.Y));
}
else
{
Point pt = new Point(MousePosition.X - tipWidth, MousePosition.Y);
sToolTip.Show(tipInfo, pt);
}
}

Is it possible?

Administrator [Syncfusion]
Replied On February 6, 2007 10:35 AM

Hi Ichiro,

You can get the width of the supper tooltip using Body.GetPreferredSize() method. Please refer to the attached sample for more details.

int width = tipInfo.Body.GetPreferredSize(int.MaxValue,true).Width;

Sample: ModifiedGDBGSuperTooltip.zip

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On February 7, 2007 12:35 AM

Hi Haneef,

Thank you for your quick response.
Body.GetPreferredSize() method was exactly what I have needed!
By handling this method, I have accomplish to display superTooltip at the left side of the cursor, when a part of superTooltip is going to be shown out of screen.

Thank you so much for your advice.

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.

;