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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.

# Multiple row count

#### Replies:

29938 Jun 7,2005 08:06 PM UTC Jun 9,2005 05:26 PM UTC WinForms 8
 Subscribe to this post Tags: GridControl
Asked On June 7, 2005 08:06 PM UTC

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.

Replied On June 7, 2005 10:15 PM UTC

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

Replied On 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.

Replied On 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.

Replied On 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.

Replied On June 9, 2005 02:06 PM UTC

Replied On June 9, 2005 02:18 PM UTC

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

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

Replied On June 9, 2005 05:26 PM UTC

Try indexing Grid.Model instead of Grid.

CONFIRMATION

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.