Hi Gaukhar Massabayeva,
Thank you for your interest in Syncfusion.
Sorry for the inconvenience caused with delay we have
analyzed your query with the provided details. You can set the tooltip for the
cells which contain the large text using the PrepareViewSyleInfo event please
refer the following codes for your references.
void
gridControl1_PrepareViewStyleInfo(object
sender, GridPrepareViewStyleInfoEventArgs e)
{
//e.Style.CellTipText
= e.Style.Text;
GridCurrentCell
cc = this.gridControl1.CurrentCell;
GridTextBoxCellRenderer
rend = this.gridControl1.CurrentCellRenderer as GridTextBoxCellRenderer;
if
(rend != null)
{
int
textLength = rend.Control.Text.Length * 6;
if
(this.gridControl1.ColWidths[cc.ColIndex] <
textLength)
e.Style.CellTipText =
e.Style.Text;
else
e.Style.CellTipText = "";
}
}
2. To customize the tooltip text display by the AutoPopDelay
code. Please refer the following code to delay.
this.gridControl1.CellToolTip.AutoPopDelay
= 1000;
Please refer the attached sample file also which contain the
above workaround and let me know if you need any more helps regarding this. We will
provide better solution for you.
Regards,
Vinish
Hi Gaukhar,
Sorry for the inconvenience caused.
Query show tool tip on a
grid grouping control cell, if text length is greater than the width of the
column |
We have deeply analyzed your query to show tool tip on a if
text length is greater than the width of the column. You can use the TableControl’s MouseMove event and check
whether the cell text length is greater than the cell’s column width, if the
text length is larger than the column width then show the tooltip with cell's
text. This can be achieved by "Active" property of the
tooltip object. The following code explains the same. Please use the attached sample file also. Sample file : http://www.syncfusion.com/downloads/Support/DirectTrac/105872/GGC_CustomToolTip-838514140.zip |
Please let me know if you have any concerns.
Regards,
Vinish
//Event Triggering
gridControl1.MouseMove += GridControl1_MouseMove;
//Event Customization
private void GridControl1_MouseMove(object sender, MouseEventArgs e)
{
int row, col;
Point p = new Point(e.X, e.Y);
gridControl1.PointToRowCol(p, out row, out col);
GridStyleInfo style = gridControl1[row, col] as GridStyleInfo;
if(style!=null)
{
Graphics g = gridControl1.CreateGraphics();
float a = g.MeasureString(style.CellValue.ToString(), style.GdipFont).Width;
if (this.gridControl1.ColWidths[col] < a)
{
style.CellTipText = style.Text;
}
else
style.CellTipText = "";
}
} |