今天发现GridView控件绑定列里用了DataFormatString,竟然没有效果出来。但DataGrid的就可以.
GridView控件不能格式化!不知道是否是个Bug!
GridView控件不能格式化!不知道是否是个Bug! <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="Exid" DataSourceID="SqlDataSource1">
GridView控件不能格式化!不知道是否是个Bug!            
<Columns>
GridView控件不能格式化!不知道是否是个Bug!                               
GridView控件不能格式化!不知道是否是个Bug!                
<asp:BoundField DataField="Eatexes" HeaderText="GridView-price"  DataFormatString="{0:F2}"/>
GridView控件不能格式化!不知道是否是个Bug!              
GridView控件不能格式化!不知道是否是个Bug!            
</Columns>
GridView控件不能格式化!不知道是否是个Bug!        
</asp:GridView>
GridView控件不能格式化!不知道是否是个Bug!        
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=WEBSERVER;Initial Catalog=demo;User ID=sa;Password=123"
GridView控件不能格式化!不知道是否是个Bug!            ProviderName
="System.Data.SqlClient" SelectCommand="SELECT * FROM [CL_expenses]">
GridView控件不能格式化!不知道是否是个Bug!        
</asp:SqlDataSource>
GridView控件不能格式化!不知道是否是个Bug!        
GridView控件不能格式化!不知道是否是个Bug!        
<asp:DataGrid ID="dd" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
GridView控件不能格式化!不知道是否是个Bug!            
<Columns>
GridView控件不能格式化!不知道是否是个Bug!                
<asp:BoundColumn DataField="Eatexes" DataFormatString="{0:F2}" HeaderText="DataGrid-price"></asp:BoundColumn>
GridView控件不能格式化!不知道是否是个Bug!            
</Columns>
GridView控件不能格式化!不知道是否是个Bug!        
</asp:DataGrid>

相关文章: