• 模板列解决一行多列表间关联


    前台页面    

            </f:TemplateField>
                        <f:TemplateField HeaderText="普通巡检频次" Width="60px">
                            <ItemTemplate>
                                <asp:Label ID="Label2" runat="server" Text='<%# GetFrequency(Eval("freq")) %>'></asp:Label>
                            </ItemTemplate>  

                  </f:TemplateField>

    后台       

        private Area[] arr;        

        private void LoadData()        

        {            

          arr = DB.Areas.ToArray();           //数据准备 

           // 每页记录数            

        Grid1.PageSize = ConfigHelper.PageSize;            

        ddlGridPageSize.SelectedValue = ConfigHelper.PageSize.ToString();

                BindGrid();

            }

            protected string GetFrequency(object freq)        

        {             string tmpStr = "";

                  var  tmpInt = Convert.ToInt32(freq);            

          foreach (var a in arr)            

          {                

             if (a.ID == tmpInt)                

            {                    

               tmpStr =  a.Name;                    

               break;                

            }            

          }            

         return tmpStr;       

      }

  • 相关阅读:
    设置页面标题title
    路由跳转,页面位置不在顶部
    PyTorch深度学习入门
    删除ubuntu后开机进入grub的解决办法
    研一上英语
    python中常用的几个函数的正确用法-lambda/filter/map/reduce
    【Python教程】 re 模块中findall() 函数返回值展现方式的用法详解
    【Python教程】5种常见字符串去除空格的操作方法
    对python中浅拷贝和深拷贝分析详细介绍
    Git使用
  • 原文地址:https://www.cnblogs.com/xihong2014/p/4099476.html
Copyright © 2020-2023  润新知