datagrid columns wrapping

G

Guest

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
 
S

Scott Mitchell [MVP]

rodchar said:
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 address removed)
http://www.4GuysFromRolla.com

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

Guest

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

Scott Mitchell [MVP]

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 address removed)
http://www.4GuysFromRolla.com

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

Guest

thanks for the lead article.

Scott Mitchell said:
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 address removed)
http://www.4GuysFromRolla.com

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top