2 promise 1980 promise_1980 于 2016.04.09 14:21 提问

请教下表头固定的方法
 <div class="searchParm" id="CompanyTypeZone">
    公司类型:<asp:TextBox ID="tb_CompanyType" Width="400"
        runat="server"></asp:TextBox>
</div>
<div class="searchParm" id="SearchZone">
    <asp:Button ID="btn_Search" runat="server" Text="查&nbsp;&nbsp;&nbsp;&nbsp;询" OnClick="btn_Search_Click"
        Width="80px" />
</div>
<div id="SearchResultZone" title="SearchResult" class="SearchResult" runat="server">
    <SharePoint:SPGridView ID="sp_GridView" runat="server" AutoGenerateColumns="False"
        AllowPaging="True" PageSize="100" Font-Size="11px">
        <AlternatingRowStyle CssClass="ms-alternating" />
        <SelectedRowStyle CssClass="ms-selectednav" Font-Bold="True" />
        <Columns>
            <SharePoint:SPBoundField DataField="CISDataSources" HeaderText="数据来源" SortExpression="CISDataSources">
            </SharePoint:SPBoundField>
            <SharePoint:SPBoundField DataField="CISCustomerName" HeaderText="姓名" SortExpression="CISCustomerName">
            </SharePoint:SPBoundField>
            <SharePoint:SPBoundField DataField="CISCompanyName" HeaderText="公司名称" SortExpression="CISCompanyName">
            </SharePoint:SPBoundField>
            <%--<SharePoint:SPBoundField DataField="CISCompanyCode" HeaderText="公司代码" SortExpression="CISCompanyCode">
            </SharePoint:SPBoundField>--%>
            <SharePoint:SPBoundField DataField="CISSubCompany" HeaderText="子公司" SortExpression="CISSubCompany">
            </SharePoint:SPBoundField>
            <SharePoint:SPBoundField DataField="CISDepartment" HeaderText="部门" SortExpression="CISDepartment">
            </SharePoint:SPBoundField>
            <SharePoint:SPBoundField DataField="CISFunction" HeaderText="职能" SortExpression="CISFunction">
            </SharePoint:SPBoundField>
            <SharePoint:SPBoundField DataField="CISPosition" HeaderText="职位" SortExpression="CISPosition">
            </SharePoint:SPBoundField>
            <%--<SharePoint:SPBoundField DataField="CISPositionLevel" HeaderText="职位级别" SortExpression="CISPositionLevel">
            </SharePoint:SPBoundField>--%>
            <SharePoint:SPBoundField DataField="CISMobile" HeaderText="手机号" SortExpression="CISMobile">
            </SharePoint:SPBoundField>
            <SharePoint:SPBoundField DataField="CISEmail" HeaderText="邮箱" SortExpression="CISEmail">
            </SharePoint:SPBoundField>
            <SharePoint:SPBoundField DataField="CISTelphone" HeaderText="电话" SortExpression="CISTelphone">
            </SharePoint:SPBoundField>
            <SharePoint:SPBoundField DataField="CISOfficeProvince" HeaderText="办公省份" SortExpression="CISOfficeProvince">
            </SharePoint:SPBoundField>
            <SharePoint:SPBoundField DataField="CISOfficeCity" HeaderText="办公城市" SortExpression="CISOfficeCity">
            </SharePoint:SPBoundField>
            <%--<SharePoint:SPBoundField DataField="CISOfficeAddress" HeaderText="办公地址" SortExpression="CISOfficeAddress">
            </SharePoint:SPBoundField>--%>
            <%--<SharePoint:SPBoundField DataField="CISSecurityLevel" HeaderText="保密级别" SortExpression="CISSecurityLevel">
            </SharePoint:SPBoundField>--%>
            <SharePoint:SPBoundField DataField="CISMark" HeaderText="备注" SortExpression="CISMark">
            </SharePoint:SPBoundField>
            <SharePoint:SPBoundField DataField="CISIndustry" HeaderText="行业" SortExpression="CISIndustry">
            </SharePoint:SPBoundField>
            <%--<SharePoint:SPBoundField DataField="CISSubIndustry" HeaderText="子行业" SortExpression="CISSubIndustry">
            </SharePoint:SPBoundField>
            <SharePoint:SPBoundField DataField="CISSubdivisionIndustry" HeaderText="细分行业" SortExpression="CISSubdivisionIndustry">
            </SharePoint:SPBoundField>--%>
            <SharePoint:SPBoundField DataField="CISRelatedProduct" HeaderText="相关产品" SortExpression="CISRelatedProduct">
            </SharePoint:SPBoundField>
            <%--<SharePoint:SPBoundField DataField="CISDesignationNum" HeaderText="名称号" SortExpression="CISDesignationNum">
            </SharePoint:SPBoundField>--%>
        </Columns>
    </SharePoint:SPGridView>
    <SharePoint:SPGridViewPager ID="SPGridViewPagerUserInfoList" runat="server" GridViewId="sp_GridView"
        OnClickNext="SPGridViewPagerUserInfoList_ClickNext" OnClickPrevious="SPGridViewPagerUserInfoList_ClickPrevious">
    </SharePoint:SPGridViewPager>

我想把SPGridView固定住,麻烦大家帮忙看看我这个SPGridView怎么固定,具体代码该如何写,万分感谢啊

2个回答

CSDNXIAOD
CSDNXIAOD   2016.04.09 14:32

固定Datagrid表头的简单方法
----------------------biu~biu~biu~~~在下问答机器人小D,这是我依靠自己的聪明才智给出的答案,如果不正确,你来咬我啊!

showbo
showbo   Ds   Rxr 2016.04.11 10:59

用repeater绑定数据,然后结合下面的示例
CSS表格固定表头示例

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!