Ejemplo n.º 1
0
        /// <summary>
        /// 填充缓冲结果。
        /// </summary>
        /// <param name="index">当前页码。</param>
        /// <param name="sourceLayer">图层</param>
        /// <param name="tableResult">IFeature转换成的DataTable。</param>
        public void ShowQueryResult(int index, IFeatureLayer sourceLayer, DataTable tableResult)
        {
            if (index == 0) //是否是第一页,若是第一页则清空之前的所有结果
            {
                TabControlFeatureList.TabPages.Clear();
                dockPanelBufferResult.Text = @"查询结果(0)";
            }

            if (sourceLayer != null && tableResult != null)
            {
                string layerName = sourceLayer.Name;
                MapSelectedFeatureListControl gv = new MapSelectedFeatureListControl
                {
                    Dock = DockStyle.Fill,
                    Name = layerName + "_" + _count
                };
                _count++;
                gv.Layer = sourceLayer;
                gv.GCFeatureList.DataSource = tableResult;
                gv.GVFeatureList.BestFitColumns();
                XtraTabPage pTabPage = new XtraTabPage {
                    Name = layerName + "_" + _count
                };
                _count++;
                pTabPage.Text = layerName + @"(" + tableResult.Rows.Count + @")";
                pTabPage.Controls.Add(gv);
                TabControlFeatureList.TabPages.Add(pTabPage);
                ShowFeaturesCount();
                if (dockPanelBufferResult.Visibility != DockVisibility.Visible)
                {
                    dockPanelBufferResult.Visibility = DockVisibility.Visible;
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 载入属性查询结果
        /// </summary>
        /// <param name="sourceLayer"></param>
        /// <param name="tableResult"></param>
        public void ShowQueryResult(IFeatureLayer sourceLayer, DataTable tableResult)
        {
            //是否是第一页,若是第一页则清空之前的所有结果
            TabControlFeatureList.TabPages.Clear();
            dockPanelBufferResult.Text = @"查询结果";
            if (sourceLayer == null || tableResult == null)
            {
                return;
            }

            MapSelectedFeatureListControl gv = new MapSelectedFeatureListControl
            {
                Dock = DockStyle.Fill,
                Name = sourceLayer.Name + "_" + _count
            };

            _count++;
            gv.Layer = sourceLayer;
            gv.GCFeatureList.DataSource = tableResult;
            gv.GVFeatureList.BestFitColumns();
            XtraTabPage pTabPage = new XtraTabPage();

            pTabPage.Name = sourceLayer.Name + "_" + _count; _count++;
            pTabPage.Text = sourceLayer.Name + @"(" + tableResult.Rows.Count + @")";
            pTabPage.Controls.Add(gv);
            TabControlFeatureList.TabPages.Add(pTabPage);
            ShowFeaturesCount();
            if (dockPanelBufferResult.Visibility != DockVisibility.Visible)
            {
                dockPanelBufferResult.Visibility = DockVisibility.Visible;
            }
        }