Exemple #1
0
 /// <summary>
 /// �׳��¼�
 /// </summary>
 /// <param name="found">��ѯ������ݼ�</param>
 protected void RaiseFoundChanged(DataTable found)
 {
     if (OnFoundChanged != null)
     {
         EventArgsFound e = new EventArgsFound(found);
         OnFoundChanged(this, e);
     }
 }
        /// <summary>
        /// 处理查询结果事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected virtual void DoOnFoundChanged(object sender, EventArgsFound e)
        {
            dgResult.Columns.Clear();
            dgResult.DataSource = e.Data;

            // 修改列标题
            if (e.Data != null)
            {
                ChangeShowHeader(e.Data.TableName);
            }

            // 隐藏列
            if (e.Data != null)
            {
                AutoHideColumns(e.Data.TableName);
            }
            int irowcount = e.Data.Rows.Count;
            if (RowDistinctField != "" && e.Data.Rows.Count > 0)
            {
                if(e.Data.Columns.IndexOf(RowDistinctField) >=0)
                    irowcount = e.Data.DefaultView.ToTable(true, RowDistinctField).Rows.Count;
            }
            //lblResult.Text = string.Format(ResourceService.GetString("Global.FoundTitle"), e.Data == null ? 0 : irowcount);

            //dgResult.AutoResizeColumnHeadersHeight();
        }