Esempio n. 1
0
        private void UpdateDisplay()
        {
            if (comboBox1.SelectedIndex < 0)
            {
                dataRowEditor1.SetDataRow(m_sites.NewsitecatalogRow());
                dataGridViewSiteProperties.DataSource = null;

                return;
            }

            var row = m_sites[comboBox1.SelectedIndex];

            this.dataRowEditor1.SetDataRow(row);

            var siteid = row["siteid"].ToString();

            m_props.Columns["siteid"].DefaultValue     = siteid;
            m_props.Columns["id"].AutoIncrement        = true;
            m_props.Columns["id"].AutoIncrementSeed    = m_props.NextID();
            m_props.DefaultView.RowFilter              = "siteid = '" + siteid + "'";
            this.dataGridViewSiteProperties.DataSource = m_props;

            dataGridViewSiteProperties.Columns["siteid"].Visible = false;
            dataGridViewSiteProperties.Columns["id"].Visible     = false;
        }
Esempio n. 2
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBox1.SelectedIndex < 0)
            {
                dataRowEditor1.SetDataRow(m_sites.NewsitecatalogRow());
                return;
            }

            var row = m_sites[comboBox1.SelectedIndex];

            this.dataRowEditor1.SetDataRow(row);

            var siteid = row["siteid"].ToString();

            m_props.Columns["siteid"].DefaultValue     = siteid;
            m_props.Columns["id"].AutoIncrement        = true;
            m_props.Columns["id"].AutoIncrementSeed    = m_props.NextID();
            m_props.DefaultView.RowFilter              = "siteid = '" + siteid + "'";
            this.dataGridViewSiteProperties.DataSource = m_props;
        }