Posted 17 March 2020, 7:14 am EST
Hi Yap,
To show the ellipsis in the cell you need to set the Trimming property CellStyle object to StringTrimming.EllipsisCharacter as given below:
c1FlexGrid1.Styles.Normal.Trimming = StringTrimming.EllipsisCharacter;
If you want to use the default Cell Label to show when there is an ellipsis sign in the cell then you just need to set the ShowCellLabels property of C1FlexGrid to true.
If you want to show ToolTip when there is Ellipsis sign there in the cell then use the MouseMove event as given below:
private void C1FlexGrid1_MouseMove(object sender, MouseEventArgs e)
{
HitTestInfo hitTestInfo = c1FlexGrid1.HitTest(e.X,e.Y);
if (hitTestInfo.Type == HitTestTypeEnum.Cell)
{
string measureString = c1FlexGrid1.GetDataDisplay(hitTestInfo.Row, hitTestInfo.Column).ToString();
SizeF stringSize = new SizeF();
Graphics g = c1FlexGrid1.CreateGraphics();
stringSize = g.MeasureString(measureString, c1FlexGrid1.Font);
if((stringSize.Width / c1FlexGrid1.Cols[hitTestInfo.Column].WidthDisplay) > 1)
{
toolTip1.Show(c1FlexGrid1[hitTestInfo.Row, hitTestInfo.Column].ToString(), c1FlexGrid1, hitTestInfo.X + 15, hitTestInfo.Y + 5);
}
else
{
toolTip1.Hide(c1FlexGrid1);
}
}
}
Please find the attached sample demonstrating the same.
Regards,
Prabhat Sharma.
FlexGridToolTip_Modified.zip