using System;
using System.Windows.Forms;

namespace ExtensionMethods
{
	/// <summary>
	/// <para>Add extensions to <c><see cref="DataGridView"/></c></para>
	/// </summary>
	public static class DataGridViewExtensions
	{
		/// <summary>
		/// <para>Refresh the BindingContext of this <see cref="DataGridView"/></para>
		/// </summary>
		/// <param name="dgv"></param>
		public static void RefreshDataSource(this DataGridView dgv)
		{
			((CurrencyManager)dgv.BindingContext[dgv.DataSource]).Refresh();
		}
	}
}