gridview no header display

try by setting showheader="false" in gridivew,
it still show the header with data inside.
untitled07.bmp
LVL 1
doramail05Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

halfbloodprinceCommented:
Are you sure the 1st row is the header??It looks like actual data
Dhanasekaran SengodanCommented:
can u post sample code?
halfbloodprinceCommented:
this is my code in the aspx page:

<asp:GridView ID="gvList" runat="server" ShowHeader="false" AutoGenerateColumns="false">
        <Columns>
            <asp:TemplateField>
                <HeaderTemplate>
            <table cellpadding="0" cellspacing="0" width="100%">
                <tr>
                    <td style="width:10%">Item #</td>
                    <td style="width:30%">Description</td>
                </tr>
            </table>
        </HeaderTemplate>
                <ItemTemplate>
                    <table cellpadding="0" cellspacing="0" width="100%">
                         <tr>
                        <td style="width:10%"><%#Eval("ItemNumber") %></td>
                        <td style="width:30%"><%#Eval("LongDescription")%></td>
                    </tr>
                    </table>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
       
       </asp:GridView>

And this is in the code behind:
Dim objSQLConn As New SqlConnection
        Dim strConn As String = "server=YOURSERVERNAME;database=YOURDBNAME_dev;uid=sa;pwd=sql#2005"
        objSQLConn.ConnectionString = strConn
        Dim objSQLCmd As New SqlCommand
        Dim sa As New SqlDataAdapter
        Dim dsItems As New Data.DataSet
        objSQLCmd.Connection = objSQLConn
        objSQLCmd.CommandText = "Select * From Items Where CollectionID = 17"
        objSQLCmd.CommandType = Data.CommandType.Text
        sa.SelectCommand = objSQLCmd
        sa.Fill(dsItems)
        gvList.DataSource = dsItems
        gvList.DataBind()


Now in the aspx code snippet,inspite of having a header template,its not seen,bcause ive set shoeHedare="False" If I set it to true I can see the header..
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

doramail05Author Commented:
here they are
javascript
----------

function s() {
        var t = document.getElementById("<%=gvLevel.ClientID%>");
       
        var t2 = t.cloneNode(true)
        for (i = t2.rows.length - 1; i > 0; i--)
            t2.deleteRow(i)
        t.deleteRow(0)
        a.appendChild(t2)
    }
    window.onload = s 


aspx
----
<div id="a">
            </div>
            <div style="overflow-y: scroll; height: 100px; width:320px;">
              <asp:GridView ID="gvLevel" runat="server" ShowHeader="false" 
        AutoGenerateColumns="False" AllowPaging="false" CssClass="datatable"
                    CellPadding="5" BorderWidth="1px" BorderColor="#6E6E6E" 
                 Font-Names="Arial" Font-Size="Small" 
                 GridLines="None" AlternatingRowStyle-BackColor="#efefef" 
            Width="300px" 
                 
            AllowSorting="True" onrowdatabound="gvLS_RowDataBound" 
                    onsorting="gvLevel_Sorting"   >
          
                    <Columns>
                    
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:CheckBox ID="cbLevel" runat="server" />
                            <asp:Label ID="lblLIDField" Visible="false" Text='<%# Eval("id") %>' runat="server" />
                    
                         </ItemTemplate>
                    </asp:TemplateField>

                    <asp:BoundField  DataField="code" 
                            SortExpression="code"  ItemStyle-CssClass="first" ReadOnly="True"  
                             ItemStyle-HorizontalAlign="Left">


<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>
                        
                            <asp:BoundField  DataField="name" 
                            SortExpression="name"  ItemStyle-CssClass="first" ReadOnly="True"  
                             ItemStyle-HorizontalAlign="Left">


<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>
                       
                     
                    </Columns>
       
                         </asp:GridView>

codebehind
----------
DataTable dt2 = new DataTable();
                string strSQL2 = "Select * from levels";
                SqlDataAdapter adapter2 = new SqlDataAdapter(strSQL2, sqlconn);
                adapter2.Fill(dt2);

                gvLevel.Attributes.Add("style", "table-layout:fixed");

                gvLevel.DataSource = dt2;
                gvLevel.DataBind();

Open in new window

Alfred A.Commented:
Your ShowHeader="false" I believe is working.  Did you made some adjustments with the rows during creation and binding?  What I meant is there logic happening inside your GridView RowCreated or RowDataBound events?  It is possible that you might be populating the header row with data through this events.
doramail05Author Commented:
i checked,

there's somewhere i notice if there's a fixed header function in the code attach above that might affected it, but im not sure
Alfred A.Commented:
Did you mean this one?

gvLevel.Attributes.Add("style", "table-layout:fixed");

Which one are you pertaining to?  Can you then try removing it and test it if it still occurs?
doramail05Author Commented:
yes, if i remove it, it does not affect the header column.
Alfred A.Commented:
OK.  What happen is you set ShowHeader="true"?  Can you show me a snapshot of your gvLevel GridView after running it with showheader="true"?  A
doramail05Author Commented:
showheader = "true";
untitled09.bmp
Alfred A.Commented:
OK.  Like I said before, your showheader="false" works fine.

Can you clarify this? -----> there's somewhere i notice if there's a fixed header function in the code attach above that might affected it, but im not sure

Is this in your code snippet?  If not can you show it please?
doramail05Author Commented:
here are all the code for aspx, i tried to remove cssclass="datatable" in the gridview, but still cannot  


 <asp:GridView ID="gvLevel" runat="server" ShowHeader="false"
        AutoGenerateColumns="False" AllowPaging="false"
                    CellPadding="5" BorderWidth="1px" BorderColor="#6E6E6E"
                 Font-Names="Arial" Font-Size="Small"
                 GridLines="None" AlternatingRowStyle-BackColor="#efefef"
            Width="300px"
                 
            AllowSorting="True" onrowdatabound="gvLS_RowDataBound"
                    onsorting="gvLevel_Sorting"   >
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="g_subject.aspx.cs" Inherits="admin_generalfolder_g_subject" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
        }
        .style2
        {
            width: 12px;
        }
        .style3
        {
            width: 38px;
        }
        .style4
        {
            text-align: center;
        }
        .style5
        {
            width: 11px;
        }
        
        .style7
        {
            width: 38px;
            height: 19px;
        }
        .style8
        {
            width: 135px;
            height: 19px;
        }
        .style9
        {
            width: 12px;
            height: 19px;
        }
        .style10
        {
            width: 243px;
            height: 19px;
        }
        .style11
        {
            width: 11px;
            height: 19px;
        }
        .style12
        {
            width: 38px;
            height: 23px;
        }
        .style13
        {
            height: 23px;
        }
        .style14
        {
            width: 12px;
            height: 23px;
        }
        .style15
        {
            text-align: center;
            height: 23px;
        }
        
        .style18
        {
            width: 158px;
        }
        .style19
        {
            width: 18px;
        }
        
        .style20
        {
            width: 18px;
            text-align: left;
        }
        
        .style21
        {
            width: 437px;
        }
        .style22
        {
            width: 139px;
        }
        .Item
        { 
          /* CSS class for non-selected Menu Item */
          background-image : url('../../images/defaultimage.jpg') no-repeat; 
        }
        
    </style>
</head>
<script type="text/javascript">
function SetUniqueRadioButton(nameregex, current)
{
   re = new RegExp(nameregex);
   for(i = 0; i < document.forms[0].elements.length; i++)
   {
      elm = document.forms[0].elements[i]
      if (elm.type == 'radio')
      {
         if (re.test(elm.name))
         {
            elm.checked = false;
         }
      }
   }
   current.checked = true;
}
</script>
<script language="javascript" type="text/javascript">
    function SelectAll(id) {
        var frm = document.forms[0];

        for (i = 0; i < frm.elements.length; i++) {
            if (frm.elements[i].type == "checkbox") {
                frm.elements[i].checked = document.getElementById(id).checked;
            }
        }
    }

    function s() {
        var t = document.getElementById("<%=gvLevel.ClientID%>");
       
        var t2 = t.cloneNode(true)
        for (i = t2.rows.length - 1; i > 0; i--)
            t2.deleteRow(i)
        t.deleteRow(0)
        a.appendChild(t2)
    }
    window.onload = s



    </script>
   
<body>
    <form id="form1" runat="server">
     <script type="text/javascript">

         var prm = Sys.WebForms.PageRequestManager.getInstance();
         prm.add_initializeRequest(prm_InitializeRequest);
         prm.add_endRequest(prm_EndRequest);

         function prm_EndRequest(sender, args) {

             var panelProg = $get('pnlPopup');
             panelProg.style.display = 'none';

         }

         function prm_InitializeRequest(sender, args) {

             var panelProg = $get('pnlPopup');
             panelProg.style.display = 'block';
             var origin = sender._postBackSettings.sourceElement.id;
             if (origin.match('btnSearchSubject') != null)
                 gridView = $get('<%= gvSubject.ClientID %>');
             else if (origin.match('gvSubject') != null)
                 gridView = $get('<%= gvSubject.ClientID %>');
             else if (origin.match('btnSearchLevel') != null)
                 gridView = $get('<%= gvLevel.ClientID %>');
             else if (origin.match('gvLevel') != null)
                 gridView = $get('<%= gvLevel.ClientID %>');

             var gridViewBounds = Sys.UI.DomElement.getBounds(gridView);
             var updateProgressDivBounds = Sys.UI.DomElement.getBounds(panelProg);
             var x = gridViewBounds.x + Math.round(gridViewBounds.width / 2) - Math.round(updateProgressDivBounds.width / 2);
             var y = gridViewBounds.y + Math.round(gridViewBounds.height / 2) - Math.round(updateProgressDivBounds.height / 2);
             Sys.UI.DomElement.setLocation(panelProg, x, y);
         }

    </script>
    <asp:ScriptManager ID="ScriptManager01" runat="server" />
    <div>
    <asp:Panel ID="Panel01" runat="server" />
    </div>
    <table style="width: 100%;">
        <tr>
            <td class="style12">
                </td>
            <td class="style13">
               
                </td>
            <td class="style14">
                </td>
            <td class="style15" colspan="3">
               <asp:Label ID="lblPageError" ForeColor="Red" Visible="false" runat="server" /></td>
            <td class="style13">
                </td>
            <td class="style13">
                </td>
        </tr>
        <tr>
            <td class="style3">
                &nbsp;</td>
            <td class="style1">
               
                <asp:Label id="lbl22" runat="server" Text="Subject Management" Font-Names="Arial" />
            </td>
            <td class="style2">
                &nbsp;</td>
            <td class="style4">
                &nbsp;</td>
            <td class="style5">
                &nbsp;</td>
            <td class="style6">
    <asp:Label id="lbl21" runat="server" Text="Choose Level" Font-Names="Arial" />
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style3">
                &nbsp;
            </td>
            <td class="style1">
               
             <asp:Label ID="lbl12" runat="server" Font-Size="Small" Font-Names="Arial" 
                                Text="Subject Code" />
            </td>
            <td class="style2">
                &nbsp;: 
            </td>
            <td align="left" >
                <asp:TextBox ID="txtSubjectCode" runat="server"></asp:TextBox>
                <span style="padding-left:10px">
                <asp:Button ID="btnGenerateSCode" runat="server" Text="Generate" onclick="btnGenerateSCode_Click" 
                  /></span>
            </td>
            <td class="style5">
                &nbsp;</td>
            <td class="style6">
                <asp:TextBox ID="txtSearchLevelName" runat="server"></asp:TextBox>
                <asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1_txtSearchLevelName" 
                    TargetControlID="txtSearchLevelName" WatermarkText="Level Name" 
                    WatermarkCssClass="watermark" runat="server"></asp:TextBoxWatermarkExtender>
                <span style="padding-left:20px"></span>
                <asp:Button ID="btnSearchLevel" runat="server" 
                    Text="Search" onclick="btnSearchLevel_Click" style="height: 26px" 
                  />
                <span style="padding-left:10px"><asp:Button ID="btnAddLevel" runat="server" 
                    Text="Add Level" 
                  />
                <asp:ModalPopupExtender ID="btnAddLevel_ModalPopupExtender"
                PopupControlID="panelLevel"
                BackgroundCssClass="modalBackground"
                PopupDragHandleControlID="panEdit"
                CancelControlID="btnAddLevelCancel" runat="server" 
                    TargetControlID="btnAddLevel">
                </asp:ModalPopupExtender>
                </span>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style7">
                &nbsp;
             </td>
            <td class="style8">
                
             <asp:Label ID="lbl13" runat="server" Font-Size="Small" Font-Names="Arial" 
                                Text="Subject Name" />
            </td>
            <td class="style9">
                :</td>
            <td class="style10">
                <asp:TextBox ID="txtSubjectName" runat="server" Width="231px"></asp:TextBox>
            </td>
            <td class="style11">
                </td>
                


            <td valign="top" colspan="3" rowspan="4">
            
            <asp:Label ID="lblSearchLevelError" ForeColor="Red" Font-Names="Arial" Visible="false" runat="server" />

            <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel2">
            <ProgressTemplate>
            </ProgressTemplate>
        </asp:UpdateProgress>

        
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnSearchLevel" EventName="Click" />
            </Triggers>
            <ContentTemplate>    
            <div id="a">
            </div>
            <div style="overflow-y: scroll; height: 100px; width:320px;">

              <asp:GridView ID="gvLevel" runat="server" ShowHeader="false" 
        AutoGenerateColumns="False" AllowPaging="false" 
                    CellPadding="5" BorderWidth="1px" BorderColor="#6E6E6E" 
                 Font-Names="Arial" Font-Size="Small" 
                 GridLines="None" AlternatingRowStyle-BackColor="#efefef" 
            Width="300px" 
                 
            AllowSorting="True" onrowdatabound="gvLS_RowDataBound" 
                    onsorting="gvLevel_Sorting"   >
          
                    <Columns>
                    
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:CheckBox ID="cbLevel" runat="server" />
                            <asp:Label ID="lblLIDField" Visible="false" Text='<%# Eval("id") %>' runat="server" />
                    
                         </ItemTemplate>
                    </asp:TemplateField>
                                            
                            <asp:BoundField  DataField="name" 
                            SortExpression="name"  ItemStyle-CssClass="first" ReadOnly="True"  
                             ItemStyle-HorizontalAlign="Left">

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                                           
                       
                     
                    </Columns>
       
                         </asp:GridView>
                         
</ContentTemplate>
        </asp:UpdatePanel>
                         </div>
                         
                         
                          </td>
                         
        </tr>
        <tr>
            <td class="style3">
                &nbsp;
             </td>
            <td class="style1">
                &nbsp;
             </td>
            <td class="style2">
                &nbsp;</td>
            <td  align="left">
                <asp:Button ID="btnSaveSubject" runat="server" Text="Save" 
                    onclick="btnSaveSubject_Click" Width="54px" /><span style="padding-left:20px">
                <asp:Button ID="btnUpdateSubject" runat="server" Text="Update" 
                    onclick="btnUpdateSubject_Click" /></span>
            </td>
            <td class="style5">
                </td>
        </tr>
        <tr>
            <td class="style3">
                &nbsp;</td>
            <td class="style1">
                &nbsp;</td>
            <td class="style2">
                &nbsp;</td>
            <td align="left" valign="top">
            &nbsp;&nbsp;
                </td>
            <td class="style5">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style3">
                &nbsp;</td>
            <td class="style1">
                &nbsp;</td>
            <td class="style2">
                &nbsp;</td>
            <td class="style4">
                &nbsp;</td>
            <td class="style5">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style3">
                &nbsp;</td>
            <td class="style1">
                &nbsp;</td>
            <td class="style2">
                &nbsp;</td>
            <td class="style4">
                &nbsp;</td>
            <td class="style5">
                &nbsp;</td>
            <td class="style6">
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style3">
                &nbsp;</td>
            <td class="style1" colspan="7">
                <asp:Label id="lbl23" runat="server" Text="Subject" 
                    Font-Names="Arial" />
            </td>
        </tr>
        <tr>
            <td class="style3">
                &nbsp;</td>
            <td class="style1" colspan="7">
                <asp:Button ID="btnDelete" runat="server" 
                    Text="Delete" onclick="btnDelete_Click" />
            &nbsp;&nbsp;&nbsp;
                <asp:TextBox ID="txtSearchSubjectCode" runat="server"></asp:TextBox>
                <asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1_txtSearchSubjectCode" TargetControlID="txtSearchSubjectCode" WatermarkText="Subject Code" WatermarkCssClass="watermark" runat="server"></asp:TextBoxWatermarkExtender>
            &nbsp;&nbsp;&nbsp;
                <asp:TextBox ID="txtSearchSubjectName" runat="server"></asp:TextBox>
                <asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender_txtSearchSubjectName" 
                    TargetControlID="txtSearchSubjectName" WatermarkText="Subject Name" 
                    WatermarkCssClass="watermark" runat="server"></asp:TextBoxWatermarkExtender>
            &nbsp;&nbsp;
                <asp:TextBox ID="txtSearchLSDesc" runat="server" Width="182px"></asp:TextBox>
                <asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender_txtSearchLSDesc" 
                    TargetControlID="txtSearchLSDesc" WatermarkText="LS Description" 
                    WatermarkCssClass="watermark" runat="server"></asp:TextBoxWatermarkExtender>
            &nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Button ID="btnSearchSubject" runat="server" Text="Search" onclick="btnSearchSubject_Click" 
                     />
            </td>
        </tr>
        <tr>
            <td class="style3">
                &nbsp;</td>
            <td class="style1" colspan="7">

            <asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
            <ProgressTemplate>
            </ProgressTemplate>
        </asp:UpdateProgress>

        
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnSearchSubject" EventName="Click" />
            </Triggers>
            <ContentTemplate>
            <asp:Label ID="lblSearchSubjectError" ForeColor="Red" Font-Names="Arial" Visible="false" runat="server" />
                 <asp:GridView ID="gvSubject" runat="server" 
        AutoGenerateColumns="False" AllowPaging="True" CssClass="datatable"
                    CellPadding="5" BorderWidth="1px" BorderColor="#6E6E6E" 
                 Font-Names="Arial" Font-Size="Small" 
                PageSize="5" GridLines="None" AlternatingRowStyle-BackColor="#efefef" 
            Width="900px"  
                 HeaderStyle-HorizontalAlign="Left" 
            AllowSorting="True" onrowdatabound="gvSubject_RowDataBound" 
                     onpageindexchanged="gvSubject_PageIndexChanged" 
                     onpageindexchanging="gvSubject_PageIndexChanging" 
                     onsorting="gvSubject_Sorting"  >
                    <HeaderStyle HorizontalAlign="Left" BackColor="#BDBDBD" />
                    <Columns>
                    
                         <asp:TemplateField>
                        <ItemTemplate>
                            <asp:CheckBox id="cbDelete" runat="server" />
                            <asp:Label ID="lblIDField" Visible="false" Text='<%# Eval("sid") %>' runat="server" />
                            <asp:Label ID="lblLSIDField" Visible="false" Text='<%# Eval("lsid") %>' runat="server" />
                                 
                         </ItemTemplate>
                         <HeaderTemplate>
                         <span style="float:left"><asp:CheckBox id="cbAll"  runat="server" /></span>
                         </HeaderTemplate>

                    </asp:TemplateField>

                        <asp:BoundField HeaderText="ID" DataField="sid" 
                            SortExpression="sid" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  
                            HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                    <asp:BoundField HeaderText="Subject Code" DataField="scode" 
                            SortExpression="scode" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  
                            HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>
                        
                            <asp:BoundField HeaderText="Subject Name" DataField="sname" 
                            SortExpression="sname" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  
                            HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                        <asp:BoundField HeaderText="Level Subject Description" DataField="lsdesc" 
                            SortExpression="lsdesc" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  
                            HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>
                       


                      
                         <asp:HyperLinkField ControlStyle-ForeColor="Black" DataNavigateUrlFields="lsid" DataNavigateUrlFormatString="g_subject.aspx?LSID={0}&g_SubjectUpdate=Y" Text="Edit" runat="server">
<ControlStyle ForeColor="Black"></ControlStyle>
                        </asp:HyperLinkField> 
                       
                     
                    </Columns>
        
                         </asp:GridView>
                         <asp:Panel ID="pnlPopup" runat="server" CssClass="progress" style="display:none;">
                <div class="container">
                    <div class="header">Loading, please wait...</div>
                    <div class="progressbody">
                        <asp:Image ID="Image3" imageid="imageprogress01" ImageUrl="~/images/activity.gif" runat="server" />
                    </div>
                </div>
            </asp:Panel>
                         
</ContentTemplate>
        </asp:UpdatePanel>
                         </td>
        </tr>
        <tr>
            <td class="style3">
                &nbsp;</td>
            <td class="style1">
                &nbsp;</td>
            <td class="style2">
                &nbsp;</td>
            <td class="style4">
                &nbsp;</td>
            <td class="style5">
                &nbsp;</td>
            <td class="style6">
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style3">
                &nbsp;</td>
            <td class="style1" colspan="5">
                <asp:Panel ID="panellevel" runat="server">
                <table style="width: 100%;">
                    <tr>
                        <td class="style22">
                            &nbsp;</td>
                        <td class="style18">
                        
                            &nbsp;</td>
                        <td class="style19">
                            &nbsp;</td>
                        <td class="style21">
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style22">
                            &nbsp; </td>
                        <td class="style18">
                            <asp:Label ID="lbl24" runat="server" Font-Names="Arial" Text="Add Level" />
                        </td>
                        <td class="style19">
                            &nbsp; </td>
                        <td class="style21">
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style22">
                            &nbsp;</td>
                        <td class="style18">
                            &nbsp;</td>
                        <td class="style19">
                            &nbsp;</td>
                        <td class="style21">
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style22">
                            &nbsp;
                        </td>
                        <td class="style18">
                            <asp:Label ID="lbl26" runat="server" Font-Names="Arial" Font-Size="Small" 
                                Text="Level Name" />
                        </td>
                        <td class="style20">
                            :</td>
                        <td class="style21">
                            <asp:TextBox ID="txtLevelName" runat="server" Width="222px"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style22">
                            &nbsp;</td>
                        <td class="style18">
                            &nbsp;</td>
                        <td class="style20">
                            &nbsp;</td>
                        <td class="style21">
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style22">
                            &nbsp;
                        </td>
                        <td class="style18">
                            &nbsp;
                        </td>
                        <td class="style19">
                            &nbsp;
                        </td>
                        <td class="style21">
                            <asp:Button ID="btnAddLevelDb" runat="server" onclick="btnAddLevelDb_Click" 
                                Text="Save" />
                            &nbsp;&nbsp;
                            <asp:Button ID="btnAddLevelCancel" runat="server" Text="Cancel" />
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style22">
                            &nbsp;</td>
                        <td class="style18">
                            &nbsp;</td>
                        <td class="style19">
                            &nbsp;</td>
                        <td class="style21">
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                    </tr>
                </table>
                
                </asp:Panel>
                
                </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style3">
                &nbsp;</td>
            <td class="style1" colspan="5">
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style3">
                &nbsp;</td>
            <td class="style1" colspan="5">
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>

    </form>
</body>
</html>

Open in new window

Alfred A.Commented:
It looks like everything is O.K.  This is a bit of a longshot but can you try removing this <div style="overflow-y: scroll; height: 100px; width:320px;">
and check the result for testing purposes?

I know this is use for auto vertical scroll bar.  And by the way, overflow-y works with I.E. but not properly with other browsers as I recall.  You might as well just use overflow:auto.  Just my two cents. :-)
doramail05Author Commented:
nice try though,

but overflow:auto gives the same result.

i originally thought this cause but
//gvLevel.Attributes.Add("style", "table-layout:fixed");
Alfred A.Commented:
Did you try commenting or removing the whole div? this one <div style="overflow-y: scroll; height: 100px; width:320px;">

I was asking for you to temporarily remove the wrapping div of the Gridview and check the result.
doramail05Author Commented:
almost,

i comment out the a.appendChild(t2)

function s() {
        var t = document.getElementById("<%=gvLevel.ClientID%>");
       
        var t2 = t.cloneNode(true)
        for (i = t2.rows.length - 1; i > 0; i--)
            t2.deleteRow(i)
        t.deleteRow(0)
        //a.appendChild(t2)
    }
    window.onload = s

the header column is gone, but the form1, (first data row) disappear too.
untitled10.bmp
Alfred A.Commented:
I noticed something,

you have this in your function s.

t.deleteRow(0)

This would delete Row 0 in the document which I believe is the header since t is actually the gvLevel gridview..  Can you try removing this and check the results?
Alfred A.Commented:
OK.  Test this as well, return a.appendChild(t2) and remove t.deleteRow(0) and test.  This might work!  

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
doramail05Author Commented:
thanx for the quick response,

i commented out a.appendChild(t2) and remove t.deleteRow(0)

and finally it worked.
:D
Alfred A.Commented:
No problem.  Glad to help!  :-)
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
ASP.NET

From novice to tech pro — start learning today.