Textarea objects instead of text boxes in datagrids

Discussion in 'ASP .Net Web Controls' started by J. Muenchbourg, Jul 8, 2004.

  1. How do I specify inside a datagrid that does edits/updates, that a
    certain field should display its contents in TEXTAREA html objects, not
    text box controls. See tag in boundcolumn/datagrid control:

    <asp:BoundColumn
    DataField="sampleletext"
    HeaderText="Sample Text">
    </asp:BoundColumn>

    ...and if I can put a textarea object in a datagrid, will I use the
    .text method to parse the data from that field name when calling my sql
    parameters and such:

    MyCommand.Parameters.Add(New SQLParameter("@sampletext",
    sampletext.text))

    ...when I tried using this reference to display "sampletext" inside a
    textarea:

    Dim sampletext As textarea = E.Item.cells(5).Controls(0)

    ...i got a "Type 'textarea' is not defined" error.

    thanks for help
    Muench


    *** Sent via Devdex http://www.devdex.com ***
    Don't just participate in USENET...get rewarded for it!
    J. Muenchbourg, Jul 8, 2004
    #1
    1. Advertising

  2. J. Muenchbourg

    Teemu Keiski Guest

    Hi,

    it is still of type TextBox. Locate it from Controls collection and change
    its TextMode property to MultiLine. You'd need to do this in ItemDataBound
    event for each and every row.

    Might be cleaner solution just to implement this/these columns as
    TemplateColumns and insert the TextBox declaratively.

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist
    http://blogs.aspadvice.com/joteke


    "J. Muenchbourg" <> wrote in message
    news:...
    >
    >
    > How do I specify inside a datagrid that does edits/updates, that a
    > certain field should display its contents in TEXTAREA html objects, not
    > text box controls. See tag in boundcolumn/datagrid control:
    >
    > <asp:BoundColumn
    > DataField="sampleletext"
    > HeaderText="Sample Text">
    > </asp:BoundColumn>
    >
    > ..and if I can put a textarea object in a datagrid, will I use the
    > text method to parse the data from that field name when calling my sql
    > parameters and such:
    >
    > MyCommand.Parameters.Add(New SQLParameter("@sampletext",
    > sampletext.text))
    >
    > ..when I tried using this reference to display "sampletext" inside a
    > textarea:
    >
    > Dim sampletext As textarea = E.Item.cells(5).Controls(0)
    >
    > ..i got a "Type 'textarea' is not defined" error.
    >
    > thanks for help
    > Muench
    >
    >
    > *** Sent via Devdex http://www.devdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    Teemu Keiski, Jul 8, 2004
    #2
    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. =?Utf-8?B?Y2hhcmxpZXdlc3Q=?=

    What to use instead of the CommandArgument in DataGrids?

    =?Utf-8?B?Y2hhcmxpZXdlc3Q=?=, Mar 31, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    3,354
    Brock Allen
    Mar 31, 2005
  2. Stefan Mueller
    Replies:
    5
    Views:
    12,356
    jamesxa
    Jun 16, 2009
  3. Coleen

    Using datagrids by row instead of by column?

    Coleen, Dec 23, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    119
    Coleen
    Dec 23, 2003
  4. J. Muenchbourg

    Textarea objects instead of text boxes in datagrids

    J. Muenchbourg, Jul 7, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    129
    J. Muenchbourg
    Jul 7, 2004
  5. Augustus
    Replies:
    1
    Views:
    338
    Ken Schaefer
    Sep 10, 2003
Loading...

Share This Page