PDA

View Full Version : Editing fields stretch DataGrid


petersza
10-29-03, 03:38 PM
When I click the edit button (EditCommandColumn) in a row of a datagrid, items in the columns on that row become textboxes, as should happen, but the textboxes are too large and stretch the entire grid (table). Is there a way to control the size of the textboxes, or to prevent this from happening somehow?

Thank you.

Peter

damodar_guduru
11-21-03, 01:09 AM
Use the template columns in the datagrid as shown below for the column in which you want to restrict the size of the textbox after edit button is pressed.

<asp:TemplateColumn>
<HeaderTemplate>
<b> Price </b>
</HeaderTemplate>
<ItemTemplate>
<asp:Label Text='<%# DataBinder.Eval Container.DataItem, "Price") %>' runat="server"/>
</ItemTemplate>

<EditItemTemplate>

<asp:TextBox Text="" runat="server" width="60px" />

</EditItemTemplate>

</asp:TemplateColumn>


I think the above one will help to solve your problem