Home > Windows Forms > DataGrid Component Calibration

DataGrid Component Calibration

September 5th, 2009 admin Leave a comment Go to comments

// Autogenerated index fields when inserting new row is attemted
DataGridView_DefaultValuesNeeded (object sender, DataGridViewRowEventArgs e)
{
    e.Row.Cells[Index1].Value = Value1;
    e.Row.Cells[Index2].Value = Value2;
}

//        Make first column disapear
DataGridViewName.RowHeadersVisible = false;
//        Alternate Row Color
DataGridViewName.AlternatingRowsDefaultCellStyle = { BackColor=Color [A=255, R=192, G=255, B=255] };
//        Dont let borders if headers are few
DataGridViewName.AutoSizeColumnMode = Fill;
//        SelectEntireRow if selected
DataGridViewName.SelectionMode = "FullRowSelect";

//  Go the new row of a datagrid and call the valuesneeded event
BindingSource.AddNew();
Categories: Windows Forms Tags:
  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.