Dave Burke : Freelance .NET Web Developer specializing in Online Communities

VS2005 Refactoring : Extract Method

Creating a new method from a code fragment in an existing method.

We're going to create a new method from the datagridview binding and sorting snippet and name it SortGrid().  The resulting code is below.



private void SortGrid()
{
this.dataGridView1.DataSource = this.messageBS;
this.dataGridView1.Sort(this.dataGridView1.Columns[2], ListSortDirection.Descending);
}

 

Comments (0) | Post RSS RSS comment feed

Posted on 5/21/2005 2:41:00 PM by Dave Burke
Categories: .NET
Tags:

Related posts


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke