J joey.powell Jul 27, 2006 #1 Does anyone know how to disable sorting in a datagridview? I mean, when a user clicks a column header, the rows should not reorder.
Does anyone know how to disable sorting in a datagridview? I mean, when a user clicks a column header, the rows should not reorder.
S sloan Jul 27, 2006 #2 Did you try removing the SortExpression in the aspx page? <asp:BoundField DataField="EmpID" HeaderText="The Employee ID" /> <asp:BoundField DataField="EmpID" HeaderText="The Employee ID" SortExpression="EmpID"/>
Did you try removing the SortExpression in the aspx page? <asp:BoundField DataField="EmpID" HeaderText="The Employee ID" /> <asp:BoundField DataField="EmpID" HeaderText="The Employee ID" SortExpression="EmpID"/>
N Nicholas Paldino [.NET/C# MVP] Jul 27, 2006 #3 Joey, You will have to cycle through each of the columns on the grid and set the SortMode property to DataGridViewColumnSortMode.NotSortable. Hope this helps.
Joey, You will have to cycle through each of the columns on the grid and set the SortMode property to DataGridViewColumnSortMode.NotSortable. Hope this helps.
J joey.powell Jul 27, 2006 #4 That did it. Thanks a lot! Joey, You will have to cycle through each of the columns on the grid and set the SortMode property to DataGridViewColumnSortMode.NotSortable. Hope this helps. -- - Nicholas Paldino [.NET/C# MVP] - (e-mail address removed) Does anyone know how to disable sorting in a datagridview? I mean, when a user clicks a column header, the rows should not reorder. Click to expand... Click to expand...
That did it. Thanks a lot! Joey, You will have to cycle through each of the columns on the grid and set the SortMode property to DataGridViewColumnSortMode.NotSortable. Hope this helps. -- - Nicholas Paldino [.NET/C# MVP] - (e-mail address removed) Does anyone know how to disable sorting in a datagridview? I mean, when a user clicks a column header, the rows should not reorder. Click to expand... Click to expand...