Exemple #1
0
        /// <summary>
        /// 获取焦点所在行号
        /// add 王冀 2012 12 18
        /// </summary>
        private void GetFocusRow()
        {
            try
            {
                if (m_EditState == EditState.Add)
                {
                    string    rowid;
                    DataTable m_ReductionDt = new DataTable();
                    m_ReductionDt = m_SqlManager.GetFocusReductionData(lookUpEditParents.EditValue.ToString(), lookUpEditChild.EditValue.ToString(), memoDESC.Text);
                    if (m_ReductionDt == null || m_ReductionDt.Rows.Count == 0)
                    {
                        return;
                    }
                    rowid = m_ReductionDt.Rows[0]["id"].ToString();

                    m_ReductionDt = m_SqlManager.GetReductionData();
                    foreach (DataRow dr in m_ReductionDt.Rows)
                    {
                        if (dr["id"].ToString() == rowid)
                        {
                            rowHandle = gridView4.GetRowHandle(Int32.Parse(dr["ROWNUM"].ToString()) - 1);
                            break;
                        }
                    }
                }
                else
                if (m_EditState == EditState.Edit)
                {
                    rowHandle = gridView4.FocusedRowHandle;
                }
            }
            catch (Exception)
            {
                throw;
            }
        }