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

Multiple row count

Hello, When I select multiple rows within a gdbg, how can I obtain a count of the sected rows without looping foreach in a GridRangeInfoList? Thanks.

8 Replies

AD Administrator Syncfusion Team June 7, 2005 10:15 PM UTC

That is the only way I would know to do it.

AD Administrator Syncfusion Team June 8, 2005 01:15 PM UTC

Clay, Would it be possible to recommend this property for next version? Thanks. Could you please assist me on two following problems. 1 - I have a DropDown cell with a form and a grouping control in the DD. When the form is droping down, it is always rendered fro the parent cell to the right. When the parent is close to the right window corner, the DD is half seen, which requires a user to move to the left it every time to see the whole DD form. How can I make sure the DD is shown to the left of the parent when it does not fit into the parent grod window?... 2 - In some situation a parent cell is read-only, how to make sure in such cases the DD is also read-only. Thanks.

AD Administrator Syncfusion Team June 8, 2005 05:58 PM UTC

Hello, Any ideas on a message posted above?????!!! Thanks. >That is the only way I would know to do it.

AD Administrator Syncfusion Team June 9, 2005 01:02 AM UTC

If you are using the dropdownform from our \in depth\DropDownFormAndUserControlSample sample, the position of the dropdown is computed in the this method. This is the that you would tweak to conditionally change the position. If this.ddForm.Location + the ddForm width put it outside the parentGrid.ClientRectangle, then you woul dwant to adjust the location.
protected override void OnButtonClicked(int rowIndex, int colIndex, int button)
	this.Grid.CurrentCell.MoveTo(rowIndex, colIndex);
	//Console.WriteLine("clicked ({0},{1})", rowIndex, colIndex);
	this.ddForm.SetValuesFromString(this.Grid.Model[rowIndex, colIndex].Text);
	Rectangle rect = this.Grid.RangeInfoToRectangle(GridRangeInfo.Cell(rowIndex, colIndex));
	this.ddForm.Location = this.Grid.PointToScreen(new Point(rect.Left, rect.Bottom));
	if(this.ddForm.ShowDialog() == DialogResult.OK)
		this.Grid.Model[rowIndex, colIndex].Text = this.ddForm.GetValuesToString();
	//base.OnButtonClicked (rowIndex, colIndex, button);
You can use the same event to set whatever controls you have on your form readonly if needed. To set the gridGroupingControl readonly, you can use the gridGroupingControl1.TableDescriptor.AllowEdit property.

AD Administrator Syncfusion Team June 9, 2005 02:06 PM UTC

Clay, Thanks for reply. Actually, I am using this method, just need to tweek it for proper positioning of the DD form. My second question was not on how to set the grouping grid to read-only, but on how to get information about the parent cell''s ReadOnly property in the main grid (it''s a gdbg). In OnButtonClicked I get access to the parent grid, but I can''t find the CurrentCell''s style information (including its ReadOnly property).Could you please help me with that? Thanks. P.S. What had happened to your site this morning??? The email wasn''t available either...Got my Mgr "ticked" ;-)

AD Administrator Syncfusion Team June 9, 2005 02:18 PM UTC

Try GridCurrentCell cc = parentgrid.CurrentCell; GridStyleInfo style = parentgrid[cc.RowIndex, cc.ColIndex];

AD Administrator Syncfusion Team June 9, 2005 04:04 PM UTC

Clay, There is no property parentgrid in OnButtonClick... I have tried to do following: GridCurrentCell cc = this.Grid.CurrentCell; GridStyleInfo style = this.Grid[cc.RowIndex, cc.ColIndex]; It does not even compile because index is no allowed in Grid in that scope... Another problem is that Style property is not available in cc . Any thoughts? Thanks. >Try > >GridCurrentCell cc = parentgrid.CurrentCell; >GridStyleInfo style = parentgrid[cc.RowIndex, cc.ColIndex]; > > >

AD Administrator Syncfusion Team June 9, 2005 05:26 PM UTC

Try indexing Grid.Model instead of Grid.

Live Chat Icon For mobile
Up arrow icon