How to set 1st column automatically sorted in Gridhttp://forums.asp.net/t/1450731.aspx/1?How+to+set+1st+column+automatically+sorted+in+GridFri, 24 Jul 2009 10:30:16 -040014507313310005http://forums.asp.net/p/1450731/3310005.aspx/1?How+to+set+1st+column+automatically+sorted+in+GridHow to set 1st column automatically sorted in Grid <p>I am using grid, it works correctly only thing that I want that first column should be sorted automatically.</p> <p>Here is my code for grid setting</p> <p>&nbsp;oGrid.DataSource = _dv;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oGrid.AutoGenerateColumns = false;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oGrid.AllowPaging = true;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oGrid.AllowSorting = true;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oGrid.Sorting &#43;= new GridViewSortEventHandler(this.oGrid_Sorting);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oGrid.PageSize = 10;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oGrid.PagerSettings.Mode = PagerButtons.NumericFirstLast;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oGrid.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;<br> </p> 2009-07-23T20:37:32-04:003310969http://forums.asp.net/p/1450731/3310969.aspx/1?Re+How+to+set+1st+column+automatically+sorted+in+GridRe: How to set 1st column automatically sorted in Grid <p>Hi Friend,</p> <p>Before adssigning source first sort the view on first column and then assign as a source to grid.</p> <p>use _dv.sort method for first column.</p> <p>prasadP<br> </p> 2009-07-24T10:30:16-04:00