GridView Headers dont fit in Edit Mode

Hi,
I have an asp.net application and I am using a gridview.
I am having a problem with the format of the gridview when I edit any of my rows. The row grows so much that my last header and control don’t fit in the grid.
I have not idea of what could be causing this.
 My gridview used to work fine before when I had textboxes in my EditItemTemplates. The only changed I made is that where I used to have a textbox, I put now an AjaxControlToolKit.combobox and  a hiddenfield.
I am attaching screen shots of before and after to help to explain the problem.
I am also attaching one section of the code. This is where I declare my new combobox control.

Any help would be appreciated.

Thanks in advance,

<asp:TemplateField HeaderText="Package" SortExpression="Level1">                                                                     
                            <EditItemTemplate>
                                <cc1:ComboBox ID="cmbEditLV1" runat="server" 
                                    Width="50px" 
                                    AutoCompleteMode="SuggestAppend" 
                                         style="display: inline;" 
                                        DropDownStyle="DropDownList" AppendDataBoundItems="True" 
                                    onselectedindexchanged="cmbEditLV1_SelectedIndexChanged" 
                                    AutoPostBack="True" MaxLength="0" DataSourceID="SqlDataSource3" 
                                    DataTextField="Level1" DataValueField="Level1" 
                                    SelectedValue='<%# Bind("Level1") %>' >
                                </cc1:ComboBox>  
                                
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lbLV1" runat="server" Text='<%# Bind("Level1") %>'></asp:Label>
                            </ItemTemplate>
                            <FooterTemplate>
                                <%--<asp:TextBox ID="txtFooterLV1" runat="server" OnTextChanged="TextBox1_TextChanged" Width="50px"></asp:TextBox>--%>
                                <cc1:ComboBox ID="cmbLV1" runat="server" AutoPostBack="True" 
                                    Width="50px" 
                                    AutoCompleteMode="SuggestAppend" 
                                        MaxLength="0" style="display: inline;" 
                                        onselectedindexchanged="cmbLV1_SelectedIndexChanged" 
                                        ontextchanged="cmbLV1_TextChanged" AppendDataBoundItems="True" 
                                        oniteminserted="cmbLV1_ItemInserted" 
                                        oniteminserting="cmbLV1_ItemInserting">
                                    <asp:ListItem></asp:ListItem>
                                </cc1:ComboBox>
                            </FooterTemplate>
                        </asp:TemplateField>

Open in new window

wbsFormat-before-crop.bmp
wbsFormat-After-crop.bmp
THEtechadminAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David RobitailleAnalyst ProgrammerCommented:
it`s look more like a problem with the Style that is applied to the gridview. (with themes, style or tags)
Could you post the gridview declaration and any CSS/ .skin file that is applied to the gridview?
 
 
0
THEtechadminAuthor Commented:
Hi davrob60,
Thanks for your response.
I am posting here the gridview declaration and also the declaration for the table that frames the gridview.
I dont have a css file linked to the gridview though.
Again, the only changes that I made was to sustitute the text boxes by comboboxes and  hiddenfields. The comboboxes have the same width than the previous textboxes.
I just noticed thought, comparing the textboxes version with my new version, that when the page loads, the gridview of the new version is wider than the previous one (about 1 "). I was wondering if that extra inch is what is causing the problem, but I really can't figure it out.
Any help would be greatly appreciated,

Thanks very much,

Al
   <table style="width: 1161px; height: 425px" id="TABLE1" onclick="return TABLE1_onclick()">
        <tr>
            <td style="font-weight: bold; font-size: large; width: 420px; color: #6a5acd; font-family: Arial; height: 23px;">
                WBS Administration</td>
            <td colspan="2" style="height: 23px">            
            </td>
        </tr>
        <tr style="vertical-align: top">
            <td colspan="3" style="height:1756px">                 <asp:UpdatePanel ID="UpdatePanel7" runat="server">
                <ContentTemplate>
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" 
                    AutoGenerateColumns="False" CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="#333333"
                    GridLines="None" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" Style="font-size: small;
                    font-family: Arial; margin-right: 0px;" Width="877px" PageSize="50" 
                    DataKeyNames="ID" ShowFooter="True" OnRowCommand="GridView1_RowCommand" 
                    OnRowDeleting="GridView1_RowDeleting" OnRowUpdating="GridView1_RowUpdating" 
                    OnDataBound="GridView1_DataBound" OnRowCreated="GridView1_RowCreated" 
                    onrowupdated="GridView1_RowUpdated" onrowdatabound="GridView1_RowDataBound">
                    <PagerSettings Mode="Numeric" />
                    <FooterStyle BackColor="SlateBlue" Font-Bold="True" ForeColor="White" />
                    <Columns>                                
//*****controls declarations here.***** 
</columns>

Open in new window

0
David RobitailleAnalyst ProgrammerCommented:
the problem is in the first line style="width: 1161px;
that will block the gridview of becoming any bigger that this when you go in edit mode.
no, forget that, the problem is in the GridView, you set the Width="877px".
Or, it may be both...
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

THEtechadminAuthor Commented:
What you say makes sense and I tried before. However, now that you said it I tried again, just to make sure I did it right.
I tried:
1- Taking both widths out
2- Taking just the gridview width out
None of this approaches worked.
Do you think it could be related to the fact that even when the grid is rendered, it is wider than the previous version? What do you think could be the reason for this width difference when I kept the same widh for all the controls?

Thanks a million,

Al
0
David RobitailleAnalyst ProgrammerCommented:
Do you think it could be related to the fact that even when the grid is rendered, it is wider than the previous version? that a passibility
you could also try to put the gridview out of the table. or in a new page if you use a master page...
I also nothe that is a <ContentTemplate>  tag remaining. do you use a update panel or something? thay render as Div and that could causes problem... try putting the whole table in the updatepanel if that the case....
 
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
THEtechadminAuthor Commented:
The problem was the UpdatePanel. I took the grid out of it and the problem was solved.

Thanks very much for your help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.