Change Font Size in Edit textbox for Datagrid?

Discussion in 'ASP .Net' started by =?Utf-8?B?QmxhaW5l?=, May 24, 2005.

  1. Pulling my hair out here!
    I have a datagrid with a number of bound columns (NOT template columns).
    When choosing to Edit, the textboxes appear, but the font is not the same as
    the original text (i.e., 8pt Tahoma).

    Anyone know how to change the Font size when the Edit box appears?
    I've tried setting up something with CSS and various changes in code, but I
    can't get anything to work.

    Perhaps I'm missing something simple?
    Appreciate any sample/example or suggestions>

    Thanks.
    =?Utf-8?B?QmxhaW5l?=, May 24, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?QmxhaW5l?=

    Brock Allen Guest

    You should be able to set the Style for your <EditItemStyle> which could
    be different than your <ItemStyle>

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > Pulling my hair out here!
    > I have a datagrid with a number of bound columns (NOT template
    > columns).
    > When choosing to Edit, the textboxes appear, but the font is not the
    > same as
    > the original text (i.e., 8pt Tahoma).
    > Anyone know how to change the Font size when the Edit box appears?
    > I've tried setting up something with CSS and various changes in code,
    > but I
    > can't get anything to work.
    > Perhaps I'm missing something simple?
    > Appreciate any sample/example or suggestions>
    > Thanks.
    >
    Brock Allen, May 24, 2005
    #2
    1. Advertising

  3. =?Utf-8?B?QmxhaW5l?=

    vgebrev

    Joined:
    Jan 30, 2008
    Messages:
    2
    This is in case someone else stumbles upon this page in search of a solution for the problem.

    You can manipulate the edit text box in the OnItemCreated event handler, like so:

    if (e.Item.ItemType == ListItemType.EditItem)
    {
    TextBox textBox = e.Item.Cells[0].Controls[0] as TextBox;
    //change the style as you see fit
    }

    In the example above, textBox would reference the box in the first column/cell of the row being edited.
    vgebrev, Jan 30, 2008
    #3
    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. dave richards
    Replies:
    2
    Views:
    608
    Paul Furman
    Feb 19, 2004
  2. Wongod
    Replies:
    2
    Views:
    707
  3. mttc
    Replies:
    2
    Views:
    2,383
    Roedy Green
    Jul 3, 2009
  4. Sharon McCarty
    Replies:
    0
    Views:
    246
    Sharon McCarty
    Nov 24, 2004
  5. Brian Rupert

    Datagrid Edit mode TextBox Size

    Brian Rupert, Sep 1, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    129
    jon smith
    Sep 15, 2004
Loading...

Share This Page