Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > datagrid columns wrapping

Reply
Thread Tools

datagrid columns wrapping

 
 
=?Utf-8?B?cm9kY2hhcg==?=
Guest
Posts: n/a
 
      10-18-2004
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
 
Reply With Quote
 
 
 
 
Scott Mitchell [MVP]
Guest
Posts: n/a
 
      10-18-2004
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.velocityreviews.com/forums/(E-Mail Removed)
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!
 
Reply With Quote
 
 
 
 
=?Utf-8?B?cm9kY2hhcg==?=
Guest
Posts: n/a
 
      10-19-2004
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
> (E-Mail Removed)
> http://www.4GuysFromRolla.com
>
> * When you think ASP.NET, think 4GuysFromRolla.com!
>

 
Reply With Quote
 
Scott Mitchell [MVP]
Guest
Posts: n/a
 
      10-19-2004
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
(E-Mail Removed)
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
>> (E-Mail Removed)
>> http://www.4GuysFromRolla.com
>>
>>* When you think ASP.NET, think 4GuysFromRolla.com!
>>

 
Reply With Quote
 
=?Utf-8?B?cm9kY2hhcg==?=
Guest
Posts: n/a
 
      10-22-2004
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
> (E-Mail Removed)
> 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
> >> (E-Mail Removed)
> >> http://www.4GuysFromRolla.com
> >>
> >>* When you think ASP.NET, think 4GuysFromRolla.com!
> >>

>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrapping Gridview Columns james.parish@email.com ASP .Net 2 06-09-2006 04:20 PM
Binded Datagrid Formatting columns or hiding columns ton ASP .Net Web Controls 2 02-11-2004 04:09 AM
Wrapping Columns in a Table =?Utf-8?B?RGF2aWQgQ29l?= ASP .Net 2 02-02-2004 06:11 PM
How to turn wrapping off for datagrid columns Scott ASP .Net 1 01-08-2004 12:07 AM
Columns and Inherited Datagrid...Active Schema does not support columns rob thomson ASP .Net Datagrid Control 0 09-04-2003 03:09 PM



Advertisments