Beispiel #1
0
        protected virtual int CalcRowPreviewEditorHeight(int rowHandle, RepositoryItem item)
        {
            if (!View.OptionsView.ShowPreview || View.IsGroupRow(rowHandle) || View.IsFilterRow(rowHandle))
            {
                return(0);
            }
            int res         = (View.OptionsView.ShowPreviewRowLines != DevExpress.Utils.DefaultBoolean.False ? 1 : 0);
            int eventHeight = View.RaiseMeasurePreviewHeightAccessMetod(rowHandle);

            if (eventHeight != -1)
            {
                return(eventHeight == 0 ? 0 : res + eventHeight);
            }
            Graphics g = GInfo.AddGraphics(null);

            try
            {
                IHeightAdaptable ha = fRowPreviewViewInfo as IHeightAdaptable;
                if (ha != null)
                {
                    fRowPreviewViewInfo.EditValue = View.GetRowPreviewValue(rowHandle);
                    res = ha.CalcHeight(GInfo.Cache, this.CalcRowPreviewWidth(rowHandle) - this.PreviewIndent - (GridRowPreviewPainter.PreviewTextIndent * 2));
                }
                res = Math.Max(fRowPreviewViewInfo.CalcMinHeight(g), res);
            }
            finally
            {
                GInfo.ReleaseGraphics();
            }
            res += GridRowPreviewPainter.PreviewTextVIndent * 2;
            return(res);
        }
Beispiel #2
0
 int IAutoHeightControl.CalcHeight(GraphicsCache cache)
 {
     if (ViewInfo.IsReady)
     {
         IHeightAdaptable ih = ViewInfo as IHeightAdaptable;
         if (ih != null)
         {
             return(ih.CalcHeight(cache, Width));
         }
     }
     return(Height);
 }