miércoles, 6 de julio de 2016

Creación ToolTip

private void authorizedtoolTipController_GetActiveObjectInfo(object sender, ToolTipControllerGetActiveObjectInfoEventArgs e) 
{
GridHitInfo hi =      normalView.CalcHitInfo(normalView.GridControl.PointToClient(Control.MousePosition));
 ToolTipControlInfo info = null;

 if (hi != null && hi.RowHandle >= 0) 
 {
   string str = e.SelectedControl.ToString();
   object o = hi.HitTest.ToString() + hi.RowHandle.ToString();
   if (hi.InRowCell) 
   {
     string text = String.Empty;
     if (hi.Column == colAuthorizedState) 
     {
       var colValue = normalView.GetRowCellValue(hi.RowHandle, colAuthorizedState);
       switch (colValue.ToStringValue()) 
       {
         case "AP":
           if (dtimage != null) {
           text = (from item in dtimage.AsEnumerable()
           where item.Field("indimaind") == "ACAU"
           select item.Field("ctedetdes")).SingleOrDefault();
           }
           break;
         case "PE":
           if (dtimage != null) 
           {
             text = (from item in dtimage.AsEnumerable()
             where item.Field("indimaind") == "PEAU"
             select item.Field("ctedetdes")).SingleOrDefault();
           }
           break;
         case "NO":
           if (dtimage != null) 
           {
            text = (from item in dtimage.AsEnumerable()
            where item.Field("indimaind") == "NOAU"
            select item.Field("ctedetdes")).SingleOrDefault();
           }
           break;
         default:
           break;
       }
    }
    if (hi.Column == colObservation) 
    {
    text = normalView.GetRowCellValue(hi.RowHandle, colObservation).ToStringValue();
    }
    info = new ToolTipControlInfo(o, text);
   }
 }
   if (info != null)
      e.Info = info;
}

No hay comentarios: