K
ken busse
The code below is used to bind dataview with a filter and
sort but the full datatable without the sort or filter
being applied is being displayed.
What am I doing wrong below in my code?
Also, how do I see what is the actual dataview in my
debugger?
The table in the DVM is the underlying datatable before
the filter and sort is applied I am assuming because this
is what I am seeing. I don't see a dataview object in the
DVM while debugging.
Private dvm As DataViewManager
Private dv As DataView
Thanks,
Ken
Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If IsPostBack = False Then
MySqlDataAdapter1.Fill(DataSet11)
dvm = New DataViewManager
dvm.DataSet = DataSet11
dvm.DataViewSettings("ROLES").Sort = "RoleName"
dvm.DataViewSettings("ROLES").RowFilter
= "RoleName='Teacher'"
UltraWebGrid1.DataSource = dvm
UltraWebGrid1.DataMember = "ROLES"
UltraWebGrid1.DataBind()
'Storing grid and DataViewManager in session
state.
Session("ultrawebgrid1") = UltraWebGrid1
Session("dvm") = dvm
Else
dvm = Session("dvm")
UltraWebGrid1 = Session("ultrawebgrid1")
UltraWebGrid1.DataBind()
End If
End Sub
sort but the full datatable without the sort or filter
being applied is being displayed.
What am I doing wrong below in my code?
Also, how do I see what is the actual dataview in my
debugger?
The table in the DVM is the underlying datatable before
the filter and sort is applied I am assuming because this
is what I am seeing. I don't see a dataview object in the
DVM while debugging.
Private dvm As DataViewManager
Private dv As DataView
Thanks,
Ken
Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If IsPostBack = False Then
MySqlDataAdapter1.Fill(DataSet11)
dvm = New DataViewManager
dvm.DataSet = DataSet11
dvm.DataViewSettings("ROLES").Sort = "RoleName"
dvm.DataViewSettings("ROLES").RowFilter
= "RoleName='Teacher'"
UltraWebGrid1.DataSource = dvm
UltraWebGrid1.DataMember = "ROLES"
UltraWebGrid1.DataBind()
'Storing grid and DataViewManager in session
state.
Session("ultrawebgrid1") = UltraWebGrid1
Session("dvm") = dvm
Else
dvm = Session("dvm")
UltraWebGrid1 = Session("ultrawebgrid1")
UltraWebGrid1.DataBind()
End If
End Sub