We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Parent grid with multiple child grids

Hi, I am using a GridHierDataBoundGrid. I have two child grids that need to drop down from this grid. How can I specify this in code? Right now I am only able to see one dropdown arrow for one of the children grids - I need to see a dropdown for both. Thanks! Chuck

2 Replies

AD Administrator Syncfusion Team February 2, 2004 11:03 PM UTC

You can show 2 buttons in the cell where you now have one. You can do it by: 1) adding code in the renderer''s Constructor to add another button. public DropDownGridCellRenderer(GridControlBase grid, GridCellModelBase cellModel) : base(grid, cellModel) { this.DisableTextBox = true; DropDownButton = new GridCellComboBoxButton(this); this.AddButton(new GridCellComboBoxButton(this)); this.dbgrid = null; } 2) set the button bar size in the model''s constructor. public DBDropDownGridCellModel(GridModel grid) : base(grid) { ButtonBarSize = new Size(2 * 20, 20); } 3) Add a OnButtonClicked override to catch the click on either button. A this point, you would have to decide which child grid you want to see, and implement some way to show it. protected override void OnButtonClicked(int rowIndex, int colIndex, int button) { MessageBox.Show(button.ToString() + " clicked"); //base.OnButtonClicked (rowIndex, colIndex, button); }


AD Administrator Syncfusion Team February 3, 2004 02:54 AM UTC

Thanks again Clay >You can show 2 buttons in the cell where you now have one. You can do it by: > >1) adding code in the renderer''s Constructor to add another button. > >public DropDownGridCellRenderer(GridControlBase grid, GridCellModelBase cellModel) > : base(grid, cellModel) >{ > this.DisableTextBox = true; > DropDownButton = new GridCellComboBoxButton(this); > this.AddButton(new GridCellComboBoxButton(this)); > this.dbgrid = null; >} > > >2) set the button bar size in the model''s constructor. > >public DBDropDownGridCellModel(GridModel grid) > : base(grid) >{ > ButtonBarSize = new Size(2 * 20, 20); >} > > >3) Add a OnButtonClicked override to catch the click on either button. A this point, you would have to decide which child grid you want to see, and implement some way to show it. > >protected override void OnButtonClicked(int rowIndex, int colIndex, int button) >{ > MessageBox.Show(button.ToString() + " clicked"); > //base.OnButtonClicked (rowIndex, colIndex, button); >} >

Loader.
Up arrow icon