Avatar of rutledgj
rutledgj
 asked on

asp gridview - limiting cell width

I have a gridview that I'm trying to limit the width of a column. I'm using this  code to set the width:

<asp:TemplateField HeaderText="Note"  >
                                 <EditItemTemplate>
                                     <asp:Label ID="Label1" width="100px" runat="server" Text='<%# Eval("note") %>'></asp:Label>
                                 </EditItemTemplate>
                                 <ItemTemplate>
                                     <asp:Label ID="Label1" width="100px" runat="server" Text='<%# Bind("note") %>'></asp:Label>
                                 </ItemTemplate>
                                 <ItemStyle Width="100px" Wrap="False" />
                             </asp:TemplateField>

The result is the cell is only 100px but the data is full length and extends into the adjoining column.  

My goal is to only display a short amount of text and when the user clicks on the cell a popup window will open displaying the entire contents.

Any suggestions?
ASP.NET

Avatar of undefined
Last Comment
Rajar Ahmed

8/22/2022 - Mon
Rajar Ahmed

do u mean that the content doesnot have spaces ?

Like this ?
"abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef"
rutledgj

ASKER
No. There is a lot of text that is in the column. I just want to display a small portion of it (controlled by the column width) and when the cell is clicked I want a popup window to display the entire contents.
ASKER CERTIFIED SOLUTION
Rajar Ahmed

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes