Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '------------------------------------------------------------------------------------------
- ' Notice of My Copyright and Intellectual Property Rights
- '
- ' Any intellectual property contained within the program by Joseph L. Bolen remains the
- ' intellectual property of the Joseph L. Bolen. This means that no person may distribute,
- ' publish or provide such intellectual property to any other person or entity for any
- ' reason, commercial or otherwise, without the express written permission of Joseph L. Bolen.
- '
- ' Copyright © 2015. All rights reserved.
- ' All trademarks remain the property of their respective owners.
- '-------------------------------------------------------------------------------------------
- DataGridiView Properties Settings Notes:
- This documentation is at: http://pastebin.com/nCZDAmRG
- .AllowUserToOrderColumns = True
- .AlternatingRowsDefaultCellStyle.BackColor = Color.WhiteSmoke
- .Anchor = Top, Bottom, Left, Right (or Dock = Fill)
- .AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells (or DisplayedCellsExceptHeader)
- .BorderStyle = BorderStyle.Fixed3D
- .ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithAutoHeaderText
- (Default. However, if SelectionMode is not "RowHeaderSelect" or "ColumnHeaderSelect", you may wish to
- change this to "EnableAlwaysIncludeHeaderText".)
- .ColumnHeadersDefaultCellStyle.Font = New Font(.Font, FontStyle.Bold) NOTE: Only works in code.
- .ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing (Default is AutoSize.)
- .DataSource = (Set to your BindingSource)
- .MultiSelect = False (default True)
- .RowHeadersVisible = True (If ReadOnly on DataGridView, you may wish to use False.
- SelectionMode = RowHeaderSelect (default) or FullRowSelect
- Individual Cells of DataGridView:
- 1) If special processing is to be done on the cell, then rename the column's Name property to a more descriptive name, e.g., "LastNameCol".
- 2) If Numeric or DateTime, then format and align ...
- .Columns("BirthDateCol").DefaultCellStyle.Format = "d"
- .Columns("BirthDateCol").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
- .Columns("HireDateCol").DefaultCellStyle.Format = "yyyy-MM-dd"
- .Columns("PriceCol").DefaultCellStyle.Format = "C"
- .Columns("PriceCol").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
- Use Numeric and DateTime Format Specifiers - "d, t, s, u, C, N, etc."
- Last Cell of DataGridView:
- AutoSizeMode = Fill (All other cells NotSet)
- MinimumWidth = 100 (?)
- Special Note:
- If a column cell is Frozen, all columns to the left are Frozen.
Advertisement
Add Comment
Please, Sign In to add comment