Not able to loop throgh the Intersoft controls in runtime to change their properties dynamically

1 reply. Last post: May 16, 2013 11:46 PM by Bernard Xiang
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
naga Member

I am trying to loop through the intersoft controls controls in the code behind and changing their properties runtime depending on a condition. I have all these intersoft controls put in div tag, so I looped through the div control to get to the actual intersoft control.

I am able to get to the WebPaneManager and change its properties runtime but I am not able to get the Web Nav Pane and Web Grid.

The code below is what I am using to achieve the above scenario. Please advise me of how can I loop through other controls and set their values dynamically on runtime.

                Dim myForm As Control = Page.FindControl("Form1")
                Dim ctl As Control
                For Each ctl In myForm.Controls
                    If ctl.GetType().ToString().Equals("System.Web.UI.HtmlControls.HtmlGenericControl") Then
                        Dim dCtl As Control
                        For Each dCtl In ctl.Controls
                            If dCtl.GetType().ToString().Equals("ISNet.WebUI.WebDesktop.WebPaneManager") Then
                                If CType(dCtl, ISNet.WebUI.WebDesktop.WebPaneManager).Visible = True Then
                                    CType(dCtl, ISNet.WebUI.WebDesktop.WebPaneManager).PaneSettings.ContainerStyle.BackColor = Color.Black
                                End If
                            If dCtl.GetType().ToString().Equals("ISNet.WebUI.WebDesktop.WebNavPane") Then
                                If CType(dCtl, ISNet.WebUI.WebDesktop.WebNavPane).Visible = True Then
                                    CType(dCtl, ISNet.WebUI.WebDesktop.WebNavPane).BackColor = Color.Black
                                End If
                            End If
                            If dCtl.GetType().ToString().Equals("ISNet.WebUI.WebGrid.WebGrid") Then
                                If CType(dCtl, ISNet.WebUI.WebGrid.WebGrid).Visible = True Then
                                    CType(dCtl, ISNet.WebUI.WebGrid.WebGrid).BackColor = Color.Black
                                End If
                            End If
                        Next
                    End If
                Next
All times are GMT -5. The time now is 3:26 AM.
Previous Next