datagrid columns wrapping

Discussion in 'ASP .Net' started by =?Utf-8?B?cm9kY2hhcg==?=, Oct 18, 2004.

  1. Hey all,

    I have a datagrid that auto-generate the columns. When I run the app some of
    the column values are wrapping. How do I prevent the values from wrapping?

    Do I have to use template columns to accomplish this feat?

    thanks,
    rodchar
     
    =?Utf-8?B?cm9kY2hhcg==?=, Oct 18, 2004
    #1
    1. Advertising

  2. rodchar wrote:
    > Hey all,
    >
    > I have a datagrid that auto-generate the columns. When I run the app some of
    > the column values are wrapping. How do I prevent the values from wrapping?
    >
    > Do I have to use template columns to accomplish this feat?


    No, you should be able to use a standard BoundColumn. Try setting the
    Wrap property to False. Does that do the trick for you?

    --

    Scott Mitchell

    http://www.4GuysFromRolla.com

    * When you think ASP.NET, think 4GuysFromRolla.com!
     
    Scott Mitchell [MVP], Oct 18, 2004
    #2
    1. Advertising

  3. some of my fields are really long text fields, how can I shorten the column
    length? the wrapping=false worked, thank you.
    rodchar

    "Scott Mitchell [MVP]" wrote:

    > rodchar wrote:
    > > Hey all,
    > >
    > > I have a datagrid that auto-generate the columns. When I run the app some of
    > > the column values are wrapping. How do I prevent the values from wrapping?
    > >
    > > Do I have to use template columns to accomplish this feat?

    >
    > No, you should be able to use a standard BoundColumn. Try setting the
    > Wrap property to False. Does that do the trick for you?
    >
    > --
    >
    > Scott Mitchell
    >
    > http://www.4GuysFromRolla.com
    >
    > * When you think ASP.NET, think 4GuysFromRolla.com!
    >
     
    =?Utf-8?B?cm9kY2hhcg==?=, Oct 19, 2004
    #3
  4. Rod, there are a couple options for shortening the column length. You
    can specify a Width using the WIdth property. It can be either a
    percentage of an absolute number of pixels.

    Alternatively, you could use the LimitColumn, a custom DataGrid column
    class that limits a column's text output to a page developer-specified
    number of words. You can learn more about this custom DataGrid column,
    and get the code, at:
    http://aspnet.4guysfromrolla.com/articles/100202-1.aspx

    Happy Programming!

    --

    Scott Mitchell

    http://www.4GuysFromRolla.com

    * When you think ASP.NET, think 4GuysFromRolla.com!

    rodchar wrote:
    > some of my fields are really long text fields, how can I shorten the column
    > length? the wrapping=false worked, thank you.
    > rodchar
    >
    > "Scott Mitchell [MVP]" wrote:
    >
    >
    >>rodchar wrote:
    >>
    >>>Hey all,
    >>>
    >>>I have a datagrid that auto-generate the columns. When I run the app some of
    >>>the column values are wrapping. How do I prevent the values from wrapping?
    >>>
    >>>Do I have to use template columns to accomplish this feat?

    >>
    >>No, you should be able to use a standard BoundColumn. Try setting the
    >>Wrap property to False. Does that do the trick for you?
    >>
    >>--
    >>
    >> Scott Mitchell
    >>
    >> http://www.4GuysFromRolla.com
    >>
    >>* When you think ASP.NET, think 4GuysFromRolla.com!
    >>
     
    Scott Mitchell [MVP], Oct 19, 2004
    #4
  5. thanks for the lead article.

    "Scott Mitchell [MVP]" wrote:

    > Rod, there are a couple options for shortening the column length. You
    > can specify a Width using the WIdth property. It can be either a
    > percentage of an absolute number of pixels.
    >
    > Alternatively, you could use the LimitColumn, a custom DataGrid column
    > class that limits a column's text output to a page developer-specified
    > number of words. You can learn more about this custom DataGrid column,
    > and get the code, at:
    > http://aspnet.4guysfromrolla.com/articles/100202-1.aspx
    >
    > Happy Programming!
    >
    > --
    >
    > Scott Mitchell
    >
    > http://www.4GuysFromRolla.com
    >
    > * When you think ASP.NET, think 4GuysFromRolla.com!
    >
    > rodchar wrote:
    > > some of my fields are really long text fields, how can I shorten the column
    > > length? the wrapping=false worked, thank you.
    > > rodchar
    > >
    > > "Scott Mitchell [MVP]" wrote:
    > >
    > >
    > >>rodchar wrote:
    > >>
    > >>>Hey all,
    > >>>
    > >>>I have a datagrid that auto-generate the columns. When I run the app some of
    > >>>the column values are wrapping. How do I prevent the values from wrapping?
    > >>>
    > >>>Do I have to use template columns to accomplish this feat?
    > >>
    > >>No, you should be able to use a standard BoundColumn. Try setting the
    > >>Wrap property to False. Does that do the trick for you?
    > >>
    > >>--
    > >>
    > >> Scott Mitchell
    > >>
    > >> http://www.4GuysFromRolla.com
    > >>
    > >>* When you think ASP.NET, think 4GuysFromRolla.com!
    > >>

    >
     
    =?Utf-8?B?cm9kY2hhcg==?=, Oct 22, 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. Scott
    Replies:
    1
    Views:
    379
    Andrew de la Harpe
    Jan 8, 2004
  2. =?Utf-8?B?RGF2aWQgQ29l?=

    Wrapping Columns in a Table

    =?Utf-8?B?RGF2aWQgQ29l?=, Feb 2, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    362
    =?Utf-8?B?VGltIFN0YWxs?=
    Feb 2, 2004
  3. Wrapping Gridview Columns

    , Jun 9, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    3,070
    PeterKellner
    Jun 9, 2006
  4. rob thomson
    Replies:
    0
    Views:
    269
    rob thomson
    Sep 4, 2003
  5. ton
    Replies:
    2
    Views:
    207
    Alvin Bruney [MVP]
    Feb 11, 2004
Loading...

Share This Page