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"



    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"
    <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. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.