I feel dirty [modified]
-
EDIT: GAH! At some point between when I snagged the idea from msdn forums, tested, committed it, and posted this; and when I went back to work it decided to stop working. :doh: :doh: :doh: :doh: I Graus VS! EDIT2: No sooner do I make my first edit but it starts working again. :(( Just committed this kludge to svn because the winforms datagridview designer was written by an idiot.
/// <summary>
/// Works around a bug in the form designer. Doesn't do any painting logic.
/// </summary>
/// <param name="sender">Unused.</param>
/// <param name="e">Unused.</param>
/// <remarks>
/// Is putting this line here to stop columns from auto-generating in the designer a WTF?
/// Yes, but so is this being the only way to do it if you want anything other than 100% default
/// datbound columns without having to do all the grid layout without the aid of the designer.
/// The AutoGenerateColumns property can't be set in the designer and the constructor is already too late.
/// </remarks>
private void DataGridView1Paint(object sender, PaintEventArgs e)
{
dataGridView1.AutoGenerateColumns = false;
}3x12=36 2x12=24 1x12=12 0x12=18
-
EDIT: GAH! At some point between when I snagged the idea from msdn forums, tested, committed it, and posted this; and when I went back to work it decided to stop working. :doh: :doh: :doh: :doh: I Graus VS! EDIT2: No sooner do I make my first edit but it starts working again. :(( Just committed this kludge to svn because the winforms datagridview designer was written by an idiot.
/// <summary>
/// Works around a bug in the form designer. Doesn't do any painting logic.
/// </summary>
/// <param name="sender">Unused.</param>
/// <param name="e">Unused.</param>
/// <remarks>
/// Is putting this line here to stop columns from auto-generating in the designer a WTF?
/// Yes, but so is this being the only way to do it if you want anything other than 100% default
/// datbound columns without having to do all the grid layout without the aid of the designer.
/// The AutoGenerateColumns property can't be set in the designer and the constructor is already too late.
/// </remarks>
private void DataGridView1Paint(object sender, PaintEventArgs e)
{
dataGridView1.AutoGenerateColumns = false;
}3x12=36 2x12=24 1x12=12 0x12=18