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.