Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void initializeColumnWidths()
- {
- foreach (DataGridViewColumn Col in customerDataGridView.Columns)
- {
- if (Col is DataGridViewTextBoxColumn)
- {
- if (Col.ValueType == typeof(System.String))
- {
- int maxlen = customerDataset.customer.Columns[Col.DataPropertyName].MaxLength;
- Col.HeaderText += string.Format("({0})", maxlen);
- (Col as DataGridViewTextBoxColumn).MaxInputLength = maxlen;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement