Hello, I'm trying to extend de GridView control with a Custom Server Control, I'm doing ok with extended properties but when I get to methods that need to re-apply or modifiy the DataSource I don't get any data in the grid, though the SQLDataSource actually retrieve data. Here is my MyGridView.applyFilter() method, which should filter the data but actually shows an empty GridView, but as I sayed, the DataSource has data. I try to find (FindControl) the SQLDataSource of the GridView (Me) and modifiy its paramters, then DataBind Me to apply the changes...
Public Sub applyFilter(ByRef container As Control, ByVal param_names() As String)
Dim final As Boolean = False
Dim NFiltro As Integer = 1
Dim ctlFilter As New Control
If Not container Is Nothing Then
Dim TheSQLDataSource As New SqlDataSource
TheSQLDataSource = container.FindControl(Me.DataSourceID)
If Not TheSQLDataSource Is Nothing Then
.SelectCommand = "My_StoredProcedure"
.SelectCommandType = SqlDataSourceCommandType.StoredProcedure
Do While Not (final)
ctlFilter = container.FindControl("bfiltro" & NFiltro)
'....APPLY FILTER VALUES TO ST
View Complete Post