Jump to content
Xtreme .Net Talk

Define the size of the edit'able fields when [Edit] in GridView (ASP.NET VS2008 C#)


Recommended Posts

Posted

I am using a GRIDVIEW (gvInfo) with AutoGenerateEditButton="true", when a users presses the button the row with cells defined as "readOnly="False" becomes edit'able (as expected) - so far this is exactly what I am looking for.

 

Now the problem is that, when the user presses EDIT the cells in question (which are now edit'able) change size (width), specifically they increase a lot - to the extend where the gridview is now totally out-of-bounds on my webpage...

 

Is there a way to control the size of the textbox used in the cells when the user is EDITING the row/cell?

 

 


<asp:GridView ID="gvInfo" runat="server" Height="99px" CellSpacing="5" AutoGenerateColumns="False" CellPadding="2"
AllowPaging="False"
AutoGenerateEditButton="true" OnRowEditing="gvRegularDosage_RowEditing"
OnRowCancelingEdit="gvRegularDosage_RowCancelingEdit" OnRowUpdating="gvRegularDosage_RowUpdating"
EmptyDataText="No records found" >
<Columns>
...
<asp:BoundField HeaderText="units" ReadOnly="false" DataField="HUMR" ItemStyle-HorizontalAlign="Left" HtmlEncode="false" />
...
</Columns>
</asp:GridView>
[/Code]

 

Any help would be greatly appreciated.

Thanks,

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...