How i can set in specific cell in a datagrid mytext?

  • Thread starter michael Schindler
  • Start date
M

michael Schindler

How i can set in a datagrid in c# widows forms in a specifig cell example
Row 3 column 4 a specifig data for example "Michael"?

I want after the user give in a cell in my datagrid additionally datas set
in the same row but in a other column but automaticly.

Is that possible an how I can realize that?

thanks

Michael
 
M

michael Schindler

withz xxx.BeginEdit(datagrid....etc)

But I have also a problem ... if i have edited a cell..changed the arrow of
the left side of the datagrid to pencil...end then does not function the
Methode "BeginnEdit" eny longer.

Has anywhere a idea...and can help me?

Please

Thanks

Michael
 
W

William Ryan

You can use this....

private void buttonSetCurrentCell_Click(object o, EventArgs e)
{
DataGridCell currentCell;
string currentCellData;

// Get the text to put into the current cell.
currentCellData = textBoxCurrentCell.Text;

// Get the current cell.
currentCell = dataGrid.CurrentCell;

// Set the current cell's data.
dataGrid[currentCell.RowNumber,currentCell.ColumnNumber] = currentCellData;
//Change currentCell.RowNumber to your numbers and Column as well
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top