Esempio n. 1
0
 static void gridView1_CalcRowHeight(object sender, DevExpress.XtraGrid.Views.Grid.RowHeightEventArgs e)
 {
     //GridView view = sender as GridView;
     //if (e.RowHandle >= 0 && e.RowHandle == view.FocusedRowHandle)
     //    e.RowHeight = 26;
     //else
     //    e.RowHeight = 24;
 }
Esempio n. 2
0
        private void OprLogGridView_CalcRowHeight(object sender, DevExpress.XtraGrid.Views.Grid.RowHeightEventArgs e)
        {
            e.RowHeight = 60;

            if (!isRowMouseDoubleClicked)
            {
                return;
            }
            GridView view = sender as GridView;

            if (e.RowHandle == view.FocusedRowHandle)
            {
                e.RowHeight = 100;
            }
        }
        private void gridView1_CalcRowHeight(object sender, DevExpress.XtraGrid.Views.Grid.RowHeightEventArgs e)
        {
            if (((sender as GridView)).IsGroupRow(e.RowHandle))
            {
                GridViewInfo viewInfo = (sender as GridView).GetViewInfo() as GridViewInfo;

                // height indents calculating
                int singleLineTextHeight = viewInfo.PaintAppearance.GroupRow.CalcTextSizeInt(viewInfo.GInfo.Graphics, "Wg", 100).Height;
                int groupRowTextOffset   = e.RowHeight - singleLineTextHeight;

                string groupRowDisplayText = viewInfo.View.GetGroupRowDisplayText(e.RowHandle);

                // current group row width obtaining
                int requredWidth = viewInfo.ViewRects.Rows.Width - viewInfo.Painter.ElementsPainter.RowPreview.GetPreviewIndent(viewInfo) * (viewInfo.View.GetRowLevel(e.RowHandle) + 2);

                // required group row height calculating
                int requiredGroupRowTextHeight = viewInfo.PaintAppearance.GroupRow.CalcTextSizeInt(viewInfo.GInfo.Graphics, groupRowDisplayText, requredWidth).Height;
                e.RowHeight = requiredGroupRowTextHeight + groupRowTextOffset;
            }
        }