Thanks clay for these answers. Still got a few problems I was going to make a sample project to demonstrate but i''ll just give you a quick rundown incase a project is not necessary.
Where do I put the code to do the resizing of the combobox. I cant find an event like ''BeforeComboBoxDrop'' and if I do it in the constructor it will work (if i set it to 50 then all rows are 50 height) but the combobox always takes up the whole cell for its main control area which looks clumsy since the dropdown doesnt then begin until the next box down. Will I have to create a custom renderer with a panel and combobox aligned to the top to achieve this?
When scrolling the tops of the rows are ''snapped to''. Can I disable this. It is annoying when scrolling and more importantly if a row height is greater than the height of the control then the bottom half of the text isnt even visible.
The AllowEnter works just fine for a text editor but if I hit return a few times then the text disappears off the top and newlines arent correctly inserted. This should be easy to see if you create a grid with AllowEnter=true and AutoSize=true. Type a word and hit return. A newline isnt entered until you start typing and then. Hit return a few more times and the whole control just tends to behave erratically.
Thanks and goodnight :)
-simon
7am, definitely bedtime
>1) Here is something to try. Handle the CurrentCellMoved event. In the handler, resize the previous cell with code something like this.
>
>GridCurrentCell cc = this.grid.CurrentCell;
>this.grid.Model.RowHeights.ResizeToFit(GridRangeInfo.Cell(cc.MovedFromRowIndex, cc.MovedFromColIndex));
>
>
>2) You can set the height of the combobox button with this code.
>
>GridComboBoxCellModel cm = (GridComboBoxCellModel)gridControl1.CellModels["ComboBox"];
>cm.ButtonBarSize = new Size(cm.ButtonBarSize.Width, 20);
>
>
>3) You can handle the ClipboardPaste event and paste any way you want to. Here is code that will paste mulitline text into a single cell.
>
>
>grid.Model.ClipboardPaste += new GridCutPasteEventHandler(Model_ClipboardPaste);
>
>private void Model_ClipboardPaste(object sender, GridCutPasteEventArgs e)
>{
> if (CurrentCell.HasCurrentCell)
> {
> DataObject data = (DataObject) Clipboard.GetDataObject();
> if(data.GetDataPresent(DataFormats.Text))
> {
> string s = (string)data.GetData(DataFormats.Text);
> grid[CurrentCell.RowIndex, CurrentCell.ColIndex].Text = s;
>
> // - Or -
> // CurrentCell.Renderer.ControlText = s;
> // CurrentCell.BeginEdit();
>
> e.Handled = true;
> }
> }
>}
>