zoukankan      html  css  js  c++  java
  • 添加操作列

    /// <summary>
    /// 根据视频通道列表更新通道信息列表
    /// </summary>
    /// <param name="rUserExtInfo">视频通道列表</param>
    private void UpdateChannelInfo(RestResult rUserExtInfo)
    {
    if (rUserExtInfo.ResultCode == 0)
    {
    DataTable dtex = rUserExtInfo.GetDataTable();

    if (dtex == null || dtex.Rows.Count == 0)
    {
    groupBoxChannel.Visible = false;
    return;
    }

    groupBoxChannel.Visible = true;

    dgvChannel.Columns.Add("channel_code", "通道编号");
    dgvChannel.Columns.Add("address", "安装位置");
    dgvChannel.Columns.Add("sip_id", "sip编号");
    dgvChannel.Columns.Add("note", "备注");
    dgvChannel.Columns.Add("alarm_user_id", "alarm_user_id");
    dgvChannel.Columns.Add("alarm_video_id", "alarm_video_id");
    dgvChannel.Columns.Add("channel_id", "channel_id");
    dgvChannel.Columns.Add("is_del", "is_del");
    dgvChannel.Columns.Add("org_code", "org_code");
    //添加查看图片的列
    DataGridViewLinkColumn linkCol = new DataGridViewLinkColumn();
    linkCol.HeaderText = "操作";
    linkCol.Name = "operator";
    dgvChannel.Columns.Add(linkCol);

    dgvChannel.Columns["channel_code"].DataPropertyName = "channel_code";
    dgvChannel.Columns["address"].DataPropertyName = "address";
    dgvChannel.Columns["sip_id"].DataPropertyName = "sip_id";
    dgvChannel.Columns["note"].DataPropertyName = "note";
    dgvChannel.Columns["alarm_user_id"].DataPropertyName = "alarm_user_id";
    dgvChannel.Columns["alarm_video_id"].DataPropertyName = "alarm_video_id";
    dgvChannel.Columns["channel_id"].DataPropertyName = "channel_id";
    dgvChannel.Columns["is_del"].DataPropertyName = "is_del";
    dgvChannel.Columns["org_code"].DataPropertyName = "org_code";
    dgvChannel.Columns["operator"].DataPropertyName = "operator";

    dgvChannel.Columns["alarm_user_id"].Visible = false;
    dgvChannel.Columns["alarm_video_id"].Visible = false;
    dgvChannel.Columns["channel_id"].Visible = false;
    dgvChannel.Columns["is_del"].Visible = false;
    dgvChannel.Columns["org_code"].Visible = false;

    dtex.DefaultView.Sort = "channel_code asc";
    //增加dtex的"operator"列
    dtex.Columns.Add("operator",typeof(String));
    foreach (DataRow item in dtex.Rows)
    {
    item["operator"] = "图片查看";

    }

    dgvChannel.DataSource = dtex;
    dgvChannel.Update();


    }

    }

  • 相关阅读:
    Codeforces Round #534 (Div. 2) D. Game with modulo 交互题
    传球游戏 dp
    欧拉通路和欧拉回路
    HDU 1116
    HDU 4970
    HDU 4557
    HDU 4864
    HDU 1565
    HDU 3046
    HDU 4240
  • 原文地址:https://www.cnblogs.com/Robert-huge/p/5501329.html
Copyright © 2011-2022 走看看