Here is the way to filter or to sort dataset and then you can bind into your datagrid
If intEventID = 0 Then
ds = DataAccess.Events.GetAllEventsByRegionID(Me.radStartDate.SelectedDate, Me.radEndDate.SelectedDate, intRegionID, intVenueID)
Else
ds = DataAccess.Events.GetEventByIDDS(intEventID)
End If
'this is used to show the valid event only
Dim eventView As DataView
eventView = ds.Tables(0).DefaultView
eventView.RowFilter = "Valid = true"
'this is used to sort
eventView.Sort = "EventID Desc"
grdEvents.DataSource = eventView
Leave a Reply