D
David C
I have an asp GridView that has the SqlDataSource below.
<asp:SqlDataSource ID="SqlvwRepairOrdersOpen" runat="server"
ConnectionString="<%$ ConnectionStrings:MgmtConnectionString %>"
SelectCommand="SELECT [RecordID], [RepairOrderID], [Problems],
[TasksToDo], [Customer], [Vehicle], [Expected], [ROTotal], [JobSize],
[PartsCount], [Payor], [SortGroup], [Parts], [InsuranceID] FROM
[vw_RepairOrdersOpen] ORDER BY [SortGroup], [RepairOrderID] DESC">
</asp:SqlDataSource>
I also have a CheckBox control with ID of ckNormalSort and when it is
checked, I want the GridView to go back to the initial sort from the
SqlDataSource. I have tried the code below in both Page_Load and in the
CheckChanged event of the checkbox and neither works. How can this be
accomplished? Thanks.
David
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If ckNormalSort.Checked = True Then
SqlvwRepairOrdersOpen.SelectCommand = "SELECT [RecordID],
[RepairOrderID], [Problems], [TasksToDo], [Customer], [Vehicle], [Expected],
[ROTotal], [JobSize], [PartsCount], [Payor], [SortGroup], [Parts],
[InsuranceID] FROM [vw_RepairOrdersOpen] ORDER BY [SortGroup],
[RepairOrderID] DESC"
SqlvwRepairOrdersOpen.DataBind()
End If
End Sub
<asp:SqlDataSource ID="SqlvwRepairOrdersOpen" runat="server"
ConnectionString="<%$ ConnectionStrings:MgmtConnectionString %>"
SelectCommand="SELECT [RecordID], [RepairOrderID], [Problems],
[TasksToDo], [Customer], [Vehicle], [Expected], [ROTotal], [JobSize],
[PartsCount], [Payor], [SortGroup], [Parts], [InsuranceID] FROM
[vw_RepairOrdersOpen] ORDER BY [SortGroup], [RepairOrderID] DESC">
</asp:SqlDataSource>
I also have a CheckBox control with ID of ckNormalSort and when it is
checked, I want the GridView to go back to the initial sort from the
SqlDataSource. I have tried the code below in both Page_Load and in the
CheckChanged event of the checkbox and neither works. How can this be
accomplished? Thanks.
David
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If ckNormalSort.Checked = True Then
SqlvwRepairOrdersOpen.SelectCommand = "SELECT [RecordID],
[RepairOrderID], [Problems], [TasksToDo], [Customer], [Vehicle], [Expected],
[ROTotal], [JobSize], [PartsCount], [Payor], [SortGroup], [Parts],
[InsuranceID] FROM [vw_RepairOrdersOpen] ORDER BY [SortGroup],
[RepairOrderID] DESC"
SqlvwRepairOrdersOpen.DataBind()
End If
End Sub