Datagrids Item Templetes not found by compiler

Discussion in 'ASP .Net Datagrid Control' started by Michael Evanchik, Dec 22, 2003.

  1. Basically im using a mutltiline textbox in a datagrid since i cant get
    text to wrap in a grid. If i refer to the textbox by id in any vb code
    the compiler says the object does not exist. If instead i refer to the
    value by the datagrid cell im getting a invalid class error from the
    same code i have always used to get values from a cell. Here is the
    code i am talking about....


    This is my datagrid code
    ---------------------------------
    <Columns>
    <asp:EditCommandColumn EditText="" UpdateText=""/>
    <asp:BoundColumn DataField="id" HeaderText="id" readonly="true" />
    etc etc etc
    <asp:TemplateColumn>
    <ItemTemplate>
    <asp:TextBox id="txt_desc_g" Text='<%# DataBinder.Eval(Container,
    "dataitem.job_description") %>' Columns="85" TextMode="MultiLine"
    rows="18" Runat="server" visible="True" ></asp:TextBox>
    </ItemTemplate>
    </asp:TemplateColumn>
    </Columns>


    If this is an a subroutine
    --------------------------------
    sub test
    txt_desc_g.text = ""
    end sub

    The compiler tells me txt_desc_g.text doest not exist


    In turn i use the code that works fine for non template columns...
    -----------------------------

    txtstr = e.item.cells(2).controls(0)
    tempstr = txtstr.text


    Im gettin an error invalid cast?


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Michael Evanchik, Dec 22, 2003
    #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. priyank

    Page templetes

    priyank, Oct 31, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    800
    priyank
    Oct 31, 2003
  2. William Parker
    Replies:
    1
    Views:
    3,093
    Martin
    Jun 27, 2004
  3. barry
    Replies:
    5
    Views:
    2,074
    barry
    Jun 9, 2006
  4. Replies:
    3
    Views:
    550
  5. Mark Janssen
    Replies:
    0
    Views:
    152
    Mark Janssen
    Apr 12, 2013
Loading...

Share This Page