I would like to find the value of some textboxes that are on tabs in a WebTab control. At runtime the tabs are created and a user control is added to the tab for each record in a table. I need the values of the textbox that are on the user control for each tab. Is there a sample somewhere? I found an old sample for the UltraWebTab but not the WebTab control.
Thanks,
Stacey
Hello Stacey,
Thank you for contacting Infragistics!
The following forum thread discusses how to find a TextBox within a UserControl, of which is also within a WebTab:
http://ko.infragistics.com/community/forums/t/60679.aspx
If you have any questions, please let me know as well.
I am now able to find the control, but the text returned from the found control is an empty string although the tab and the textboxes on it seem to be displaying correctly. Here is the code for adding the tab to the WebTab
Dim newTab As New Infragistics.Web.UI.LayoutControls.ContentTabItem
Dim newControl As WUC_CCDetail = DirectCast(LoadControl("MyUserControl.ascx"),MyUserControl)
newTab.UserControlUrl = "MyUserControl.ascx"
newControl.Part = dRow!PartNumber.ToString (this is a public property on the user control that sets the txtPartNumber textbox text)
newTab.Text = dRow!PartNumber.ToString.Trim
newTab.Controls.Add(newControl)
WebTab1.Tabs.Add(newTab)
This seems to be working. The tab is added and the part Number textbox is filled in.
This is what I'm doing to try to get the text of the part number textbox:
Dim tempPart As String
Dim octl As Control = WebTab1.Tabs(0).FindChildControl("txtPartNumber")
If octl IsNot Nothing Then
tempPart = CType(octl, TextBox).Text
End If
It finds the txtPartNumber control but the text in it is an empty string.