Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 17th, 2005, 08:27 AM
Authorized User
Join Date: Aug 2005
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default template column in datagrid

i ve template column in datagrid

<asp:TemplateColumn SortExpression="url_desc" HeaderText="Description">
                                                <ItemStyle HorizontalAlign="Left" Width="20%"></ItemStyle>
                                                    <asp:Label id=lblDesc Width="70" BorderStyle="None" Runat="server" text='<%#Container.DataItem("url_desc")%>'>
                                                    <asp:TextBox id=txt_Desc runat="server" Width="160px" TextMode="MultiLine" Rows="4" Text='<%#Container.DataItem("url_desc")%>'>
                                                    <asp:CustomValidator id="vld_txtDesc" Runat="server" ClientValidationFunction="fn_maxLength" ControlToValidate="txt_Desc"
                                                        Display="None" ErrorMessage="Description cannot exceed more than 250 characters"></asp:CustomValidator>

but when the text on this lable "lblDesc" has more length then the datagrid is getting expanded.
i don't want the width of grid to be streatched.
even setting the "ItemStyle-Wrap" doesn't work
what would be the solution for this?
Old November 18th, 2005, 06:33 PM
Registered User
Join Date: Nov 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts

Try this code in your Datagrid
<asp:TemplateColumn HeaderText="<<Write your own Header text>>">
<ItemStyle Width="20%">

Hope this helps you

Similar Threads
Thread Thread Starter Forum Replies Last Post
Template Column in datagrid prankur ASP.NET 1.0 and 1.1 Professional 1 January 7th, 2006 05:20 PM
Datagrid template column sonurijs ASP.NET 1.x and 2.0 Application Design 1 September 27th, 2005 12:55 PM
Buttons in DataGrid Template Column divsalar ASP.NET 1.x and 2.0 Application Design 1 February 1st, 2005 03:37 PM
Template Column in DataGrid and Button divsalar ASP.NET 1.x and 2.0 Application Design 1 January 23rd, 2005 12:43 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.