本文整理汇总了C#中System.Windows.Forms.DataGridView.AutoResizeRows方法的典型用法代码示例。如果您正苦于以下问题:C# DataGridView.AutoResizeRows方法的具体用法?C# DataGridView.AutoResizeRows怎么用?C# DataGridView.AutoResizeRows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.DataGridView
的用法示例。
在下文中一共展示了DataGridView.AutoResizeRows方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DailyScheduleView
public static void DailyScheduleView(DataGridView view, MainForm mainForm)
{
if (view.DataSource == null)
{
return;
}
view.ColumnHeadersVisible = false;
view.RowHeadersVisible = false;
view.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
view.AutoResizeColumns();
view.AutoResizeRows();
view.AllowUserToResizeColumns = false;
view.AllowUserToResizeRows = false;
// LessonId
view.Columns[0].Visible = false;
view.Columns[0].Width = 0;
// Ring
view.Columns[1].Width = 56;
view.Columns[1].DefaultCellStyle.Font = new Font(view.DefaultCellStyle.Font.FontFamily, 14);
view.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
// LessonSummary
// view.Columns[2].Width = Percent(88, view.Width);
view.Columns[2].Width = view.Width - view.Columns[1].Width - 20;
}
示例2: cargarGrilla
public static void cargarGrilla(DataGridView grid, System.Data.DataTable dataTable)
{
grid.DataSource = dataTable;
grid.AutoResizeColumns(); //ajusta el tamaño de las columnas y filas a su contenido
grid.AutoResizeRows();
}
示例3: TestAutoResizeRowsArgumentException
public void TestAutoResizeRowsArgumentException ()
{
DataGridView grid = new DataGridView ();
grid.AutoResizeRows (DataGridViewAutoSizeRowsMode.None);
}
示例4: TestAutoResizeRowsInvalidOperationException2
public void TestAutoResizeRowsInvalidOperationException2 ()
{
DataGridView grid = new DataGridView ();
grid.RowHeadersVisible = false;
grid.AutoResizeRows (DataGridViewAutoSizeRowsMode.DisplayedHeaders);
}
示例5: TestAutoResizeRowsInvalidEnumArgumentException
public void TestAutoResizeRowsInvalidEnumArgumentException ()
{
DataGridView grid = new DataGridView ();
grid.AutoResizeRows ((DataGridViewAutoSizeRowsMode) 4);
}