本文整理匯總了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);
}