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.
Unfortunately, activation email could not send to your email. Please try again.

Multiple row count

Thread ID:





29938 Jun 7,2005 04:06 PM Jun 9,2005 01:26 PM Windows Forms 8
Tags: GridControl
Administrator [Syncfusion]
Asked On June 7, 2005 04:06 PM

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.

Administrator [Syncfusion]
Replied On June 7, 2005 06:15 PM

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

Administrator [Syncfusion]
Replied On June 8, 2005 09:15 AM

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.

Administrator [Syncfusion]
Replied On June 8, 2005 01:58 PM

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

Administrator [Syncfusion]
Replied On June 8, 2005 09:02 PM

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.

Administrator [Syncfusion]
Replied On June 9, 2005 10:06 AM

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" ;-)

Administrator [Syncfusion]
Replied On June 9, 2005 10:18 AM

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

Administrator [Syncfusion]
Replied On June 9, 2005 12:04 PM

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]; > > >

Administrator [Syncfusion]
Replied On June 9, 2005 01:26 PM

Try indexing Grid.Model instead of Grid.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.