private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
{
if (e.SelectedControl != gridControlDetail) return;
ToolTipControlInfo info = null;
try
{
GridView view = gridControlDetail.GetViewAt(e.ControlMousePosition) as GridView;
if (view == null) return;
GridHitInfo hi = view.CalcHitInfo(e.ControlMousePosition);
if (hi.InRowCell)
{
//info = new ToolTipControlInfo(new CellToolTipInfo(hi.RowHandle, hi.Column, "cell"), GetCellHintText(view, hi.RowHandle, hi.Column));
string DtsItemCode = SysConvert.ToString(view.GetRowCellValue(hi.RowHandle,"DtsItemCode"));
string ItemDes = Common.GetItemDesByItemCode(DtsItemCode);
info = new ToolTipControlInfo(new CellToolTipInfo(hi.RowHandle, hi.Column, "cell"), ItemDes);
return;
}
//if (hi.Column != null)
//{
// info = new ToolTipControlInfo(hi.Column, GetColumnHintText(hi.Column));
// return;
//}
if (hi.HitTest == GridHitTest.GroupPanel)
{
info = new ToolTipControlInfo(hi.HitTest, "Group panel");
return;
}
if (hi.HitTest == GridHitTest.RowIndicator)
{
info = new ToolTipControlInfo(GridHitTest.RowIndicator.ToString() + hi.RowHandle.ToString(), "Row Handle: " + hi.RowHandle.ToString());
return;
}
}
finally
{
e.Info = info;
}
{
if (e.SelectedControl != gridControlDetail) return;
ToolTipControlInfo info = null;
try
{
GridView view = gridControlDetail.GetViewAt(e.ControlMousePosition) as GridView;
if (view == null) return;
GridHitInfo hi = view.CalcHitInfo(e.ControlMousePosition);
if (hi.InRowCell)
{
//info = new ToolTipControlInfo(new CellToolTipInfo(hi.RowHandle, hi.Column, "cell"), GetCellHintText(view, hi.RowHandle, hi.Column));
string DtsItemCode = SysConvert.ToString(view.GetRowCellValue(hi.RowHandle,"DtsItemCode"));
string ItemDes = Common.GetItemDesByItemCode(DtsItemCode);
info = new ToolTipControlInfo(new CellToolTipInfo(hi.RowHandle, hi.Column, "cell"), ItemDes);
return;
}
//if (hi.Column != null)
//{
// info = new ToolTipControlInfo(hi.Column, GetColumnHintText(hi.Column));
// return;
//}
if (hi.HitTest == GridHitTest.GroupPanel)
{
info = new ToolTipControlInfo(hi.HitTest, "Group panel");
return;
}
if (hi.HitTest == GridHitTest.RowIndicator)
{
info = new ToolTipControlInfo(GridHitTest.RowIndicator.ToString() + hi.RowHandle.ToString(), "Row Handle: " + hi.RowHandle.ToString());
return;
}
}
finally
{
e.Info = info;
}
}
转:http://www.dobug.net/showtopic-583.html