By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,370 Members | 1,574 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,370 IT Pros & Developers. It's quick & easy.

datagrid columns wrapping

P: n/a
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
Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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
mi******@4guysfromrolla.com
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!
Nov 18 '05 #2

P: n/a
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
mi******@4guysfromrolla.com
http://www.4GuysFromRolla.com

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

Nov 18 '05 #3

P: n/a
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
mi******@4guysfromrolla.com
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
mi******@4guysfromrolla.com
http://www.4GuysFromRolla.com

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

Nov 18 '05 #4

P: n/a
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
mi******@4guysfromrolla.com
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
mi******@4guysfromrolla.com
http://www.4GuysFromRolla.com

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

Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.