This is a migrated thread and some comments may be shown as answers.

How to increase the width of a GridBoundColumn

4 Answers 14 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jonas
Top achievements
Rank 1
Jonas asked on 16 Jul 2014, 08:46 AM
Hello,

I created a custom control that inherits from GridBoundColumn and that adds an icon after the text of the cell.

My problem occurs when I use this column in a grid (I does not specify “HeaderStyle-width” in order that the grid itself sets the column width for all columns). As you can see in the attachment, sometimes it happens that the icon goes to the next line.

Can we ensure that this column has always a width of 10px more than the value calculated by the grid ?

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 16 Jul 2014, 10:47 AM
Hi Jonas,

You try to prevent the wrapping for column cells content in order to display the full content. Please take a look at the following documentation No Wrap for Grid Cell Content

Thanks,
Princy
0
Jonas
Top achievements
Rank 1
answered on 16 Jul 2014, 11:43 AM
Thank you for the reply.

So I did :
<ceg:MailReadOnlyColumn DataField="Courriel" HeaderText="Courriel" UniqueName="Courriel" DataFormatString="<nobr>{0}</nobr>"></ceg:MailReadOnlyColumn>

But it not working because the balise <nobr></nobr> isn't put in the <td></td> (see the attachment)
0
Princy
Top achievements
Rank 1
answered on 18 Jul 2014, 08:20 AM
Hi Jonas,

Can you please share your full code snippet so as to replicate this issue.

Thanks,
Princy
0
Jonas
Top achievements
Rank 1
answered on 18 Jul 2014, 08:38 AM
Hi Princy,

I found another way to resolve my problem. I used "HtmlGenericControl("nobr") in the CreateChildControls of my custom column and it works.

Thank you !
Tags
Grid
Asked by
Jonas
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Jonas
Top achievements
Rank 1
Share this question
or