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

Discussion in 'ASP .Net Datagrid Control' started by jobs, Jul 22, 2007.

  1. jobs

    jobs Guest

    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 /
    >




    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.Count



    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 /
    >

    <asp:Label ID="RoleLabel"
    SkinID="Retailer" runat="server" Text="Role:" />
    <br />
    <asp:DropDownList
    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.
    jobs, Jul 22, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Rodriguez
    Replies:
    23
    Views:
    1,068
    David Schwartz
    Dec 9, 2003
  2. Wolfgang Brucker

    user controls: dynamiclly added child controls dont survive post back ?

    Wolfgang Brucker, Jan 14, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    502
    Victor Garcia Aprea [MVP]
    Jan 14, 2004
  3. Replies:
    0
    Views:
    189
  4. Isaac Won
    Replies:
    9
    Views:
    341
    Ulrich Eckhardt
    Mar 4, 2013
  5. Bitswapper
    Replies:
    5
    Views:
    108
    Prasad, Ramit
    Aug 27, 2013
Loading...

Share This Page