Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created January 8, 2016 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/a286b6d39a5e5eb5c3f8 to your computer and use it in GitHub Desktop.
Save bjoerntx/a286b6d39a5e5eb5c3f8 to your computer and use it in GitHub Desktop.
private void bindingSource1_CurrentChanged(object sender, EventArgs e)
{
// retrieve the current DataRow
DataRow drCurrent = ((DataRowView)bindingSource1.Current).Row;
// create a temporary copy with only the current row
DataTable dtTemp = drCurrent.Table.Clone();
dtTemp.ImportRow(drCurrent);
// merge the template with the cloned table
mailMerge1.Merge(dtTemp);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment