问题描述
- 请教下表头固定的方法
-
<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="查 询" 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怎么固定,具体代码该如何写,万分感谢啊
解决方案
解决方案二:
用repeater绑定数据,然后结合下面的示例
CSS表格固定表头示例
时间: 2024-12-10 06:00:27