I have a gridview on my ascx control that allows direct data editing. One of the fields is a text field with a limit of 50 characters. When I reach this limit and try to edit the cell, it appears as follows:
This layout is correct. However, when I try to edit another cell, it results in the following issue:
The "Mettre à jour" button breaks apart and the gridview overlaps on the right side.
I've tried to solve this using CSS properties like overflow, adding margin or padding, adjusting text alignment, etc. But so far, nothing has worked, and I am out of ideas. Any help would be greatly appreciated. Thank you.
Using inline-block on the button has brought me closer to what I want (similar to the first screenshot):
Below is the code for my <asp:GridView>
:
<asp:GridView ID="GridViewSurveillancesActives" runat="server"
AutoGenerateColumns="False"
AutoGenerateEditButton="True" DataKeyNames="ID"
DataSourceID="odsSurveillancesActives" EnableModelValidation="True"
style="margin-right: 1px"
onrowupdated="GridViewSurveillancesActives_RowUpdated"
onrowdatabound="GridViewSurveillancesActives_RowDataBound"
AutoGenerateDeleteButton="True" CellPadding="5"
onrowdeleted="GridViewSurveillancesActives_RowDeleted" Font-Size="Small"
AllowPaging="True" AllowSorting="True">
<Columns>
<asp:BoundField DataField="CreationDate" DataFormatString="{0:d}"
HeaderText="Date de création" ReadOnly="True"
SortExpression="CreationDate" />
<asp:BoundField DataField="ParamName" HeaderText="Secteur" ReadOnly="True"
SortExpression="ParamName" />
<asp:TemplateField HeaderText="Début" SortExpression="ValidFrom">
<EditItemTemplate>
<asp:TextBox ID="gridViewDateDebut" class="datepicker" runat="server" Text='<%# Bind("ValidFrom", "{0:d}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("ValidFrom", "{0:d}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fin" SortExpression="ValidTo">
<EditItemTemplate>
<asp:TextBox ID="gridViewDateFin" class="datepicker" runat="server" Text='<%# Bind("ValidTo","{0:d}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("ValidTo", "{0:d}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Commentaire" SortExpression="Comment">
<EditItemTemplate>
<asp:TextBox ID="Comment" runat="server" Text='<%# Bind("Comment") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("Comment") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>