第一次写文章发到首页,有什么不妥的地方还请各位大虾批评!

今天看到CSDN网友有问冻结DataGrid中的列的问题,以前知道一个冻结DataGrid的
Header的方法比较简单,所以想试试!

费话少说先贴源码

冻结DataGrid中的列的比较简单的实现方法!<style type="text/css">
        </style>


冻结DataGrid中的列的比较简单的实现方法!    <DIV style="Z-INDEX: 102; LEFT: 264px; OVERFLOW: auto; WIDTH: 184px; POSITION: relative; TOP: 128px; HEIGHT: 216px"
冻结DataGrid中的列的比较简单的实现方法!                ms_positioning
="GridLayout">
冻结DataGrid中的列的比较简单的实现方法!                
<asp:DataGrid id="DataGrid1" style="Z-INDEX: 103" runat="server" BorderColor="#DEBA84" BorderStyle="None"
冻结DataGrid中的列的比较简单的实现方法!                    BorderWidth
="1px" BackColor="#DEBA84" CellPadding="0" AutoGenerateColumns="False">
冻结DataGrid中的列的比较简单的实现方法!                    
<SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#738A9C"></SelectedItemStyle>
冻结DataGrid中的列的比较简单的实现方法!                    
<ItemStyle ForeColor="#8C4510" BackColor="#FFF7E7"></ItemStyle>
冻结DataGrid中的列的比较简单的实现方法!                    
<HeaderStyle Font-Bold="True" ForeColor="White"  BackColor="#A55129"></HeaderStyle>
冻结DataGrid中的列的比较简单的实现方法!                    
<FooterStyle ForeColor="#8C4510" BackColor="#F7DFB5"></FooterStyle>
冻结DataGrid中的列的比较简单的实现方法!                    
<Columns>
冻结DataGrid中的列的比较简单的实现方法!                        
<asp:BoundColumn DataField="IntegerValue" HeaderText="IntegerValue"  HeaderStyle-CssClass ="fixCol" ItemStyle-CssClass="fixCol"></asp:BoundColumn>
冻结DataGrid中的列的比较简单的实现方法!                        
<asp:BoundColumn DataField="StringValue" HeaderText="StringValue"></asp:BoundColumn>
冻结DataGrid中的列的比较简单的实现方法!                        
<asp:BoundColumn DataField="CurrencyValue" HeaderText="CurrencyValue"></asp:BoundColumn>
冻结DataGrid中的列的比较简单的实现方法!                    
</Columns>
冻结DataGrid中的列的比较简单的实现方法!                    
<PagerStyle HorizontalAlign="Center" ForeColor="#8C4510" Mode="NumericPages"></PagerStyle>
冻结DataGrid中的列的比较简单的实现方法!                
</asp:DataGrid></DIV>

以前不知道从哪位高手那里看到的fixTitle的Css,在这里谢过了!

如果你想冻结那列就把 fixCol这个Css加到 那列的HeaderStyle-CssClass 和  ItemStyle-CssClass 中去

这里我是冻结的第一列。


看看效果吧

冻结DataGrid中的列的比较简单的实现方法!

相关文章:

  • 2021-12-14
  • 2021-11-25
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-19
  • 2021-08-04
  • 2021-05-18
相关资源
相似解决方案