Active Text Boxes in Grid control

0
0

I’m trying to put a row of text boxes at the top of a datagridview.
The text boxes are there and they can be edited, but only after double clicking.
They are also not “visible” until you double click.

How can I get the textbox controls I’m adding to appear properly and also be active to type into for the entire row without the user needing to double click ?

Thanks,
Andi

  • You must to post comments
0
0

Try datagrid1.EditMode = EditOnEnter. There is no need to create textboxes for each cell, the grid does it when it enters edit mode.

  • You must to post comments
0
0

Hi Frank,

I’ll try to get a sample together, but I’ve attached a screenshot of what I’m aiming for which may explain it better

The top row in the grid has a textbox in every cell. You enter values and hit return and it adds the row.
These boxes are active, have a visible border and you just need to single click inside them to start typing.

I have tried to insert a row by adding text boxes:

var editrow = new DataGridViewRow();
foreach(var column in this.Columns)
{
var cell = new DataGridViewTextBoxCell();
editrow.Cells.Add(cell);
}
this.Rows.Insert(0, editrow);

This works as far as there are textboxes, but they do not have any kind of border nor can they be typed into until the user double clicks in the cell.
I need to have all of the text boxes in the row active, clearly visible (like the attached screen) with a border and typeable into without needing to double click in a cell.
I’m sure there’s something simple I’m missing 🙂

I hope that makes more sense.

Thanks,

Andi

Attachment
  • You must to post comments
0
0

Hi Andi,

I am sorry but I do not seem to fully understand your scenario.
Could you please attach a sample test case so we can take a closer look ?

Thanks in advance !

Best regards
Frank

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.