代码之家  ›  专栏  ›  技术社区  ›  aggicd

c#:gridpanel,每行都有url来下载文件

  •  0
  • aggicd  · 技术社区  · 8 年前

    这是我的代码隐藏网格:

    GridPanel grid = new GridPanel
    {
        Height = 200,
        EnableColumnHide = false,
        EmptyText = "No Documents",
        Store =
        {
            new Store
            {
                Model = 
                {
                    new Model 
                    {
                        Fields = { new ModelField("Name") }
                    }
                },
                DataSource = data
            }
        },
        ColumnModel =
        {
            Columns =
            {
                new Column { ID = "clmDoc", Text = "Documents Exported", DataIndex = "Name", Width = 400  }
            }
        }
    };
    

    ~/Files/Export/Documents/file1.pdf 等

    1 回复  |  直到 8 年前
        1
  •  0
  •   Fabio Barros    8 年前

    声明列如下:

    new Column()
            {                    
                Text = "MyColumn",
                DataIndex = "UrlField",
                Width = 200,
                Renderer = new Renderer("function (value, metadata, record) { return '<a href=\"http://www.mylink.com\" target=top >'+value+'<a/>'} ")
    
            }
    
    推荐文章