This is a migrated thread and some comments may be shown as answers.

bout multipage coltrol

1 Answer 51 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Webster Velasco
Top achievements
Rank 2
Webster Velasco asked on 21 Dec 2009, 04:56 PM
hi

im using tabstrip control

and i want to find all controls that my radpageview control use

want to use a same code like this on fiding the control

    Public Sub ImpostaCampiDataBase(ByVal Pagina As Page, ByVal IDWS As String, ByVal NotaMod As String) 
        ' imposta campi data base dalla pagina web 
        TestoMessaggio = "" 
        Dim c As Control 
        Dim childc As Control 
        Dim intc As Integer 
 
        Try 
            For Each c In Pagina.Controls 
                For Each childc In c.Controls 
                    If TypeOf childc Is TextBox Then 
                        If Left(CType(childc, TextBox).ID, 3) = "txt" Then 
                            ReDim Preserve param(intc) 
                            ReDim Preserve paramVal(intc) 
                            param(intc) = Mid(childc.ID, 4) 
                            paramVal(intc) = CType(childc, TextBox).Text 
                            intcintc = intc + 1 
                        End If 
                    ElseIf TypeOf childc Is Telerik.Web.UI.RadTextBox Then 
                        If Left(CType(childc, Telerik.Web.UI.RadTextBox).ID, 3) = "txt" Then 
                            ReDim Preserve param(intc) 
                            ReDim Preserve paramVal(intc) 
                            param(intc) = Mid(childc.ID, 4) 
                            paramVal(intc) = CType(childc, Telerik.Web.UI.RadTextBox).Text 
                            intcintc = intc + 1 
                        End If 
                    ElseIf TypeOf childc Is Telerik.Web.UI.RadDatePicker Then 
                        If Left(CType(childc, Telerik.Web.UI.RadDatePicker).ID, 3) = "rdp" Then 
                            ReDim Preserve param(intc) 
                            ReDim Preserve paramVal(intc) 
                            param(intc) = Mid(childc.ID, 4) 
 
                            If CType(childc, Telerik.Web.UI.RadDatePicker).IsEmpty = True Then 
                                paramVal(intc) = "" 
                            Else 
                                paramVal(intc) = CType(childc, Telerik.Web.UI.RadDatePicker).SelectedDate 
                            End If 
                            intcintc = intc + 1 
                        End If 
 
                    ElseIf TypeOf childc Is Telerik.Web.UI.RadComboBox Then 
                        If Left(CType(childc, Telerik.Web.UI.RadComboBox).ID, 3) = "lst" Then 
                            ReDim Preserve param(intc) 
                            ReDim Preserve paramVal(intc) 
                            param(intc) = Mid(childc.ID, 4) 
                            paramVal(intc) = CType(childc, Telerik.Web.UI.RadComboBox).SelectedValue 
                            intcintc = intc + 1 
                        End If 
                    End If 
                Next 
            Next 
            ReDim Preserve param(intc) 
            ReDim Preserve paramVal(intc) 
            param(intc) = "IDWS" 
            paramVal(intc) = IDWS 
            intcintc = intc + 1 
            ReDim Preserve param(intc) 
            ReDim Preserve paramVal(intc) 
            param(intc) = "NOTAMOD" 
            paramVal(intc) = NotaMod 
 
        Catch _err As Exception 
            TestoMessaggio = "Errore Imposta Campi DataBase - " + _err.Source + "->" + _err.Message 
        End Try 
 
    End Sub 

i hope u will help me

thanks a lot

regards
webster

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 22 Dec 2009, 12:32 PM
Hello,

Try the following code snippet for getting the control collection inside PageView.

VB:
 
Protected Sub Button1_Click(ByVal sender As ObjectByVal e As EventArgs) 
    ' Dim newCollection As ControlCollection = RadPageView2.Controls 
    For Each c As Control In RadPageView2.Controls 
        If TypeOf c Is TextBox Then 
            Response.Write("TextBox"
        ElseIf TypeOf c Is RadDatePicker Then 
            Response.Write("RadDatePicker"
        End If 
    Next 
End Sub 

-Shinu.
Tags
TabStrip
Asked by
Webster Velasco
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Share this question
or