zoukankan      html  css  js  c++  java
  • ASP.NET(VB):DataGrid中"加入序号列"和"截取定长字符串追加'...'"


     1."加入序号列"
    <asp:TemplateColumn HeaderText="序号">
                                                    
    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                    
    <ItemTemplate>
                                                        
    <%# Container.ItemIndex + 1%>
                                                    
    </ItemTemplate>
                                                
    </asp:TemplateColumn>
    2."截取定长字符串,并追加'...'"
    <asp:TemplateColumn HeaderText="用户要求">
                                                    
    <ItemTemplate>
                                                        
    <asp:Label runat="server" Text='<%# Left(DataBinder.Eval(Container, "DataItem.User_Request"), 15) & IIf(Container.DataItem("User_Request").Length>15, "", "") %>' tooltip='<%# DataBinder.Eval(Container, "DataItem.User_Request"%>'>
                                                        
    </asp:Label>
                                                    
    </ItemTemplate>
                                                
    </asp:TemplateColumn>
    PS::利用DataGrid模板列
  • 相关阅读:
    KY2成绩排序
    python 获取list中元素的索引
    pandas 读取指定一列数据
    python 删除列表中的第一位元素
    python 时间戳
    python 除法保留小数点后两位
    python 读取excel表格的一列数据并去重
    python中获取Excel表格sheet页整页内容
    IDEA创建spring boot项目
    servlet一些问题
  • 原文地址:https://www.cnblogs.com/ding0910/p/314091.html
Copyright © 2011-2022 走看看