How to set the size of a edit-column in a datagrid

Discussion in 'ASP .Net Datagrid Control' started by Tomas, May 18, 2004.

  1. Tomas

    Tomas Guest

    Hi

    I'm trying to set the size of the textbox that appears when clicking the
    edit-button in a datagrid, but I'cant find out how to do it.

    // Tomas
     
    Tomas, May 18, 2004
    #1
    1. Advertising

  2. Tomas

    Renato Neves Guest

    The textbox control don't have "size"! Try "width='70%'", for example.
    Note that the EditTemplate have to include the "width='100%'" to apply the
    width of the textbox.

    Renato.

    "Tomas" <> wrote in message
    news:...
    > Hi
    >
    > I'm trying to set the size of the textbox that appears when clicking the
    > edit-button in a datagrid, but I'cant find out how to do it.
    >
    > // Tomas
    >
    >
     
    Renato Neves, May 18, 2004
    #2
    1. Advertising

  3. Tomas

    Tomas Guest

    How do I apply the EditTemplate to all my textboxes?

    //Tomas
    "Renato Neves" <> skrev i meddelandet
    news:...
    > The textbox control don't have "size"! Try "width='70%'", for example.
    > Note that the EditTemplate have to include the "width='100%'" to apply the
    > width of the textbox.
    >
    > Renato.
    >
    > "Tomas" <> wrote in message
    > news:...
    > > Hi
    > >
    > > I'm trying to set the size of the textbox that appears when clicking the
    > > edit-button in a datagrid, but I'cant find out how to do it.
    > >
    > > // Tomas
    > >
    > >

    >
    >
     
    Tomas, May 18, 2004
    #3
  4. Tomas

    Renato Neves Guest

    See this site, is very good for what you want.
    http://www.datagridgirl.com/
    :)


    "Tomas" <> wrote in message
    news:#...
    > How do I apply the EditTemplate to all my textboxes?
    >
    > //Tomas
    > "Renato Neves" <> skrev i meddelandet
    > news:...
    > > The textbox control don't have "size"! Try "width='70%'", for example.
    > > Note that the EditTemplate have to include the "width='100%'" to apply

    the
    > > width of the textbox.
    > >
    > > Renato.
    > >
    > > "Tomas" <> wrote in message
    > > news:...
    > > > Hi
    > > >
    > > > I'm trying to set the size of the textbox that appears when clicking

    the
    > > > edit-button in a datagrid, but I'cant find out how to do it.
    > > >
    > > > // Tomas
    > > >
    > > >

    > >
    > >

    >
    >
     
    Renato Neves, May 18, 2004
    #4
  5. Tomas

    Tomas Guest

    Thanks for your all of those who helped me! My solution was this (C#):

    In dataGrid_ItemCreated:

    TextBox tbx = new TextBox();

    tbx = (System.Web.UI.WebControls.TextBox)e.Item.Cells.Controls[0];

    tbx.Width = Unit.Pixel(75);

    tbx.Height = Unit.Pixel(16);

    tbx.Font.Name = "Verdana";

    tbx.Font.Size = FontUnit.XXSmall;



    i is the column index.

    This is probably not the best solution but it works for me

    // Tomas


    "Renato Neves" <> skrev i meddelandet
    news:%...
    > See this site, is very good for what you want.
    > http://www.datagridgirl.com/
    > :)
    >
    >
    > "Tomas" <> wrote in message
    > news:#...
    > > How do I apply the EditTemplate to all my textboxes?
    > >
    > > //Tomas
    > > "Renato Neves" <> skrev i meddelandet
    > > news:...
    > > > The textbox control don't have "size"! Try "width='70%'", for example.
    > > > Note that the EditTemplate have to include the "width='100%'" to apply

    > the
    > > > width of the textbox.
    > > >
    > > > Renato.
    > > >
    > > > "Tomas" <> wrote in message
    > > > news:...
    > > > > Hi
    > > > >
    > > > > I'm trying to set the size of the textbox that appears when clicking

    > the
    > > > > edit-button in a datagrid, but I'cant find out how to do it.
    > > > >
    > > > > // Tomas
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Tomas, May 24, 2004
    #5
    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. San Diego Guy
    Replies:
    0
    Views:
    551
    San Diego Guy
    Aug 7, 2003
  2. Schultz
    Replies:
    3
    Views:
    567
    =?Utf-8?B?QmlsbCBCb3Jn?=
    Feb 14, 2005
  3. =?Utf-8?B?QmlkYXJrb3Rh?=

    How to set the DataGrid Row Size to a fixed size.

    =?Utf-8?B?QmlkYXJrb3Rh?=, May 19, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    827
    =?Utf-8?B?QmlkYXJrb3Rh?=
    May 19, 2005
  4. Nedu N

    controlling size of editcommand column in edit mode

    Nedu N, Aug 15, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    111
    vMike
    Aug 24, 2003
  5. Sharon McCarty
    Replies:
    0
    Views:
    252
    Sharon McCarty
    Nov 24, 2004
Loading...

Share This Page