| |

VerySource

 Forgot password?
 Register
Search
View: 734|Reply: 6

There are 3 columns in the DataGrid, and one of them is very long. How can I make him wrap in a fixed grid?

[Copy link]

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-3-17 16:30:02
| Show all posts |Read mode
There are 3 columns in the DataGrid, and one of them is very long. How can I make him wrap in a fixed grid?
A bit similar to the function of NOWRAP in ASP.
Reply

Use magic Report

0

Threads

26

Posts

20.00

Credits

Newbie

Rank: 1

Credits
20.00

 China

Post time: 2020-6-19 13:00:01
| Show all posts
Just set a width below~~~~
Reply

Use magic Report

0

Threads

23

Posts

21.00

Credits

Newbie

Rank: 1

Credits
21.00

 China

Post time: 2020-6-19 23:00:01
| Show all posts
I don’t understand what it means. The value in the DataGrid column will automatically wrap when it exceeds the column width.
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-6-20 00:30:01
| Show all posts
Where to set it up? Can you make it clear?
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-6-20 02:45:01
| Show all posts
e.Item.Cells[1].Style.Add("width","100px");
e.Item.Cells[1].Style.Add("word-wrap","break-word");

Only valid under ie.
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-6-20 09:00:02
| Show all posts
In the ItemDataBound event.
Reply

Use magic Report

0

Threads

23

Posts

21.00

Credits

Newbie

Rank: 1

Credits
21.00

 China

Post time: 2020-6-20 17:45:01
| Show all posts
Set the column width in the aspx page:
<asp:BoundColumn DataField="coname" HeaderText="enterprise name" ItemStyle-Width="10%"></asp:BoundColumn>
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list