HighTechTalks DotNet Forums  

formview child controls .. added a table and broke control loop??

ASP.net Data Grid Control microsoft.public.dotnet.framework.aspnet.datagridcontrol


Discuss formview child controls .. added a table and broke control loop?? in the ASP.net Data Grid Control forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
jobs
 
Posts: n/a

Default formview child controls .. added a table and broke control loop?? - 07-21-2007 , 07:48 PM






Well, I've narrowed the issue down to having added a table inside my
formview. Somehow I must figure out how to navigate the formview
controls around a table, likely another child control or layer to
think about .. it boils down to this:



what does this table..

<table style="width: 625px">
<tr>
<td style="width: 309px; height:
214px" valign="top">
<asp:Label ID="UserNameLabel"
SkinID="Retailer" runat="server" Text="UserName:" /><br />
<asp:TextBox ID="UserName"
SkinID="Retailer" runat="server" Text='<%# Bind("UserName") %>' /><br /
Quote:


do to this ..(that use to work before it)

the function:

Function FormviewErrors(ByVal whichformview As FormView) As
String
Dim Errors As String = Nothing


'Dim zipcode As TextBox =
CType(whichformview.FindControl("ZipCodeTextBox"), TextBox)
'Dim zip As String = zipcode.Text.ToString
Dim fcc As Integer =
whichformview.Controls(0).Controls(2).Controls.Cou nt



Dim fr As FormViewRow =
(CType(whichformview.Controls(0).Controls(1), FormViewRow))
Dim tc As TableCell = fr.Cells(0)
For i As Integer = tc.Controls.Count To 1 Step -1
Dim c As Control = tc.Controls(i - 1)

Dim x As String = c.ClientID.ToString
Dim xx As String = c.GetType().ToString

If c.GetType().ToString =
"System.Web.UI.WebControls.TextBox" Then
Dim Tbox As TextBox = CType(c, TextBox)


my formview:

BackColor="Transparent" GridLines="Both" Width="400px"
DataSourceID="DSForm"
DataKeyNames="UserId"
OnItemCreated="Form_ItemCreated">
<EditItemTemplate>
<div runat="Server">
<br />
<table style="width: 625px">
<tr>
<td style="width: 309px; height:
214px" valign="top">
<asp:Label ID="UserNameLabel"
SkinID="Retailer" runat="server" Text="UserName:" /><br />
<asp:TextBox ID="UserName"
SkinID="Retailer" runat="server" Text='<%# Bind("UserName") %>' /><br /
Quote:
asp:Label ID="RoleLabel"
SkinID="Retailer" runat="server" Text="Role:" />
<br />
<aspropDownList
ID="RoleDropDown" SkinID="Retailer" runat="server"
DataValueField="RoleName"




My function thinks there are only 3 controls under the formview, there
are actually 20. I added a table with two columns and placed all
textboxes into them. I take out the table from my formview and
function (which loops through the formview checking textboxes) works
fine.

My question: how does a table inside a formview impact childcontrols
and how do I loop through the formview now?

Thanks for any help or information.



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.