private void ChangeGroup(TreeNode node) { if (node.Tag is FieldGroupInfo) { SectionGroupInfo m_GroupInfo = new SectionGroupInfo(); m_GroupInfo.ColumnHeading = "New Section Group"; m_GroupInfo.DistinctValues = false; node.Tag = m_GroupInfo.Copy(); node.Text = m_GroupInfo.ToString(); } else { FieldGroupInfo m_GroupInfo = new FieldGroupInfo(); m_GroupInfo.GroupByField = Webb.Data.PublicDBFieldConverter.AvialableFields[0].ToString(); m_GroupInfo.ColumnHeading = "New Group"; node.Tag = m_GroupInfo.Copy(); node.Text = m_GroupInfo.ToString(); } this.C_PropertyGrid.Refresh(); this.C_GroupInfoTree.Focus(); this.C_PropertyGrid.SelectedObject = node.Tag; }
private void C_ChangeGroup_Click(object sender, System.EventArgs e) { TreeNode node = this.C_GroupInfoTree.SelectedNode; if (node == null || !(node.Tag is GroupInfo)) { return; } if (node.Tag is FieldGroupInfo) { SectionGroupInfo m_GroupInfo = new SectionGroupInfo(); m_GroupInfo.ColumnHeading = "New Section Group"; m_GroupInfo.DistinctValues = false; node.Tag = m_GroupInfo.Copy(); node.Text = m_GroupInfo.ToString(); } else { FieldGroupInfo m_GroupInfo = new FieldGroupInfo(); m_GroupInfo.GroupByField = Webb.Data.PublicDBFieldConverter.AvialableFields[0].ToString(); m_GroupInfo.ColumnHeading = "New Group"; node.Tag = m_GroupInfo.Copy(); node.Text = m_GroupInfo.ToString(); } this.C_PropertyGrid.Refresh(); this.C_GroupInfoTree.Focus(); this.C_PropertyGrid.SelectedObject = node.Tag; }