Exemplo n.º 1
0
        /// <summary>
        /// girdview绑定行事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void gvTaskList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                FSCheckBox   cbSelect = (FSCheckBox)e.Row.FindControl("cbSelect");
                FSLinkButton lbtnCopy = (FSLinkButton)e.Row.FindControl("lbtnCopy");
                FSLabel      lblID    = (FSLabel)e.Row.FindControl("lblID");

                GetCheckItemID();

                if (String.IsNullOrEmpty(lblID.Text.Trim()) || SysConvert.ToInt32(lblID.Text.Trim()) <= 0)
                {
                    cbSelect.Visible = false;
                    lbtnCopy.Visible = true;
                }
                else
                {
                    cbSelect.Visible = true;
                    lbtnCopy.Visible = false;
                    if (txtID.Text == lblID.Text)
                    {
                        cbSelect.Checked = true;
                    }
                }
                DataRowView dr = e.Row.DataItem as DataRowView;
                ListUIBase  lu = new ListUIBase();
                lu.IndicateNoData(dr["MARK"], e.Row);
            }
        }
Exemplo n.º 2
0
 private void GetCheckItemID()
 {
     foreach (GridViewRow selectRow in this.gvTaskList.Rows)
     {
         FSCheckBox cb = (FSCheckBox)selectRow.FindControl("cbSelect");
         if (cb.Checked)
         {
             FSLabel lblID = (FSLabel)selectRow.FindControl("lblID");
             txtID.Text = lblID.Text.ToString().Trim();
             break;
         }
     }
 }