Exemple #1
0
        private void dataGridView1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            IFeatureSelection pFeatureSelection = pFeatureLayer as IFeatureSelection;
            //����������
            IQueryFilter pQueryFilter = new QueryFilterClass();
            //���ù���������IJ�ѯ����
            pQueryFilter.WhereClause = dataGridView1.Columns[0].HeaderText + "=" + dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[0].Value.ToString();

            IFeatureCursor pFeatureCursor = pFeatureLayer.Search(pQueryFilter, false);
            IFeature pFeature = pFeatureCursor.NextFeature();

            SearchViewInfo frm = null;
            if (frm == null || frm.IsDisposed)
                frm = new SearchViewInfo(pFeature);

            frm.Show();
            frm.TopMost = true;
        }
Exemple #2
0
        private void dataGridView1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            IFeatureSelection pFeatureSelection = pFeatureLayer as IFeatureSelection;
            //创建过滤器
            IQueryFilter pQueryFilter = new QueryFilterClass();
            //设置过滤器对象的查询条件
            pQueryFilter.WhereClause = dataGridView1.Columns[0].HeaderText+ "=" + dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[0].Value.ToString();

            IFeatureCursor pFeatureCursor = pFeatureLayer.Search(pQueryFilter, false);
            IFeature pFeature = pFeatureCursor.NextFeature();

            SearchViewInfo frm = null;
            if (frm == null || frm.IsDisposed)
                frm = new SearchViewInfo(pFeature);

            frm.Show();
            frm.TopMost = true;
        }