Skip to content

Instantly share code, notes, and snippets.

@rockhymas
Created June 23, 2012 13:56
Show Gist options
  • Save rockhymas/2978366 to your computer and use it in GitHub Desktop.
Save rockhymas/2978366 to your computer and use it in GitHub Desktop.
ResizeGridColumns alt2
var usableWidth = dataGrid.ClientSize.Width - verticalScrollBarWidth - LAST_COL_MARGIN;
var columnWidth = usableWidth / tableStyle.GridColumnStyles.Count;
for (var index = 0; index < tableStyle.GridColumnStyles.Count; index++)
tableStyle.GridColumnStyles[index].Width = columnWidth;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment