Troubleshooting a CSS problem within ASP GridView caused by excessively lengthy text

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>

Answer №1

Experiment with adding some style to a button

display: inline-block;

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Center align Bootstrap 4 dropdown menu

I am attempting to center align my dropdown menu using Bootstrap 4. Following the given example: [ This is the result I am achieving: [ This is the code I have implemented: <div class="container"> <div class="row"> <div class=" ...

Utilize express middleware for applying CSS styles in web development

How's it going? I've been experimenting with middleware in Express JS, like this: app.get ('/user/:school/:dual', function (req, res, next) {   ......   ...   ...... }); Everything seems to be working fine so far. But when I na ...

When using CSS @media print with inches, different dimensions are displayed post-printing

I'm currently working on a project that involves printing a single div from my webpage. However, I've encountered some issues with the @page tag not affecting the print output as expected. I attempted to manually set the dimensions of the element ...

Changing the Appearance of the RStudio Editor

I am exploring options to customize an RStudio Editor Theme to personalize the colors. My current setup includes RStudio version 0.99.473 on Windows 10. After reviewing Any way to change colors in Rstudio to something other than default options?, which wa ...

What is the process for changing the border color of a Select Component?

Is there a way to change the border color of a select component in Material UI library without directly setting the property in inspect elements? I can see it working when I set the property that way, but how can this be achieved using class override? htt ...

Is it possible to incorporate personalized JavaScript alongside bootstrap?

Just recently started using bootstrap and was curious about something. Can custom JavaScript be integrated with bootstrap buttons without any additional adjustments? ...

Add a control to a webpage on the fly using a web service

Is there a way to dynamically add a control to an ASP.net webpage using a webservice called within the page load event? Here is a simplified version of the code I am working with. Thank you for your help! ''''''''& ...

Managing Cookie Expiration in Asp.Net

Attempted to check for a guest cookie and expire it if it exists: if (Request.Cookies["IsGuest"] != null) { Response.Cookies["IsGuest"].Expires = DateTime.Now.AddDays(-1); //HttpCookie myCookie = new HttpCookie("IsGuest"); //myC ...

Aligning container - property: inline-block;

Having trouble centering two divs that are set to "display: inline-block;" in your code? Removing the inline-block class centers them, but they end up stacking vertically instead of horizontally. See below for an example: #news { background-image: url ...

Harnessing conflict in HTML with various versions of jQuery can be a powerful tool for enhancing the

Is it possible to use 2 different jQuery libraries on the same HTML page? I came across some blogs mentioning conflicts, but when I tried to add them both, I had no luck. Can anyone assist me with this? Here is my code: Product slider <link hre ...

Initialization of the Gridview component

What is the initial event triggered when using a Gridview control? I'm working with a Gridview control on my .aspx page and I'm curious to know which event is fired first when interacting with the grid. Can anyone provide some insight on this? T ...

Storing Canvas Jquery data in an ASP.NET C# database

I need assistance with saving canvas (signatures) created using Asp.Net webforms and JQuery into a SQL server database. Can anyone provide suggestions on how I can achieve this? What type of field should I use to store it in the database? ...

HTML5 - Pictograms and Visual Elements

I'm having an issue with Font Awesome displaying a symbol as a box instead of what I want. Can anyone provide assistance? Thank you <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Home< ...

Ways to adjust the dimensions of a division element using Bootstrap

I have a CSS class called "brands" and I am looking to change the size of the thumbnail div within this brand class. How can I go about doing this? <div class="brands"> <div class="row"> <?php foreach ($item['brands'] ...

Each element is being adorned with the Ajax success function class

Currently, I am in the process of creating an Ajax function to integrate search features into my project. The search function itself is functioning properly; however, within the success: function, I am encountering an issue. Specifically, I am attempting t ...

I have come to realize that my understanding of how Sass nesting works was misguided

Currently struggling with understanding Sass nesting. Any explanations on where I went wrong would be greatly appreciated, as this is a beginner-level issue for me. Thank you in advance. .header { display: flex; height: 10vh; background-color: #13192 ...

Center-align text so it is perfectly centered over an image

Looking for help with aligning text in social media images? Currently, the text is positioned at the bottom of each image. Check out this example: http://jsfiddle.net/uT4Ey/ CSS: .img { background-color: red; height: 3em; width: 3em; display: inl ...

While typing in the box I am currently working on, another CSS box is shifting around

Whenever I try to add a paragraph to my box, the other one shifts. I've checked for any issues with margins or spacing, but nothing seems off from what I can tell. I have no clue how to resolve this. Here's how it appears before making any change ...

Guide to showcasing information through ajax in asp.net

When attempting to use the display function to show records from a database, I encountered an issue where it is not working and giving me an error of "undefined." Unfortunately, I am unsure of what the problem might be. <script type="text/javascrip ...

Extracting data from a dynamic table structure

Currently, I am working alongside my backend developer to address some challenges with form submissions. The specific situation involves a table within an HTML form that consists of two columns and rows that can be dynamically added. Users have the ability ...