how to change a value of particular cell in a data grid

Answers were Sorted based on User's Feedback



how to change a value of particular cell in a data grid..

Answer / amit kumar sharma

private void dataGridView1_CellClick(object sender,
DataGridViewCellEventArgs e)
{
//Edit cell value
this.dataGridView1[e.ColumnIndex,
e.RowIndex].Value="Any Thing";

//find column name of cell
string strCulumnName = dataGridView1
[e.ColumnIndex, e.RowIndex].OwningColumn.Name;
}

Is This Answer Correct ?    2 Yes 0 No

how to change a value of particular cell in a data grid..

Answer / ajaujan

e.Item.Cells[i].Text="Something"

Is This Answer Correct ?    0 Yes 0 No

how to change a value of particular cell in a data grid..

Answer / vijay saxena

GridView1.Rows[2].Cells[1].Text = "something";

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More C Sharp Interview Questions

How long will it take to learn c sharp?

0 Answers  


Can we inherit private members of class in c#?

0 Answers  


how to compare numbers and dispaly the largest ? *first thing I wanted to do is to input how many numbers to be compared *and then analyzed the largest then display it.

0 Answers  


What is the difference between “dispose” and “finalize” variables in c#?

0 Answers  


Define mutex in C#?

0 Answers  


Give examples for value types?

0 Answers  


can you allow a class to be inherited, but prevent the method from being over-ridden?

0 Answers   Siebel Systems,


I was trying to use an out int parameter in one of my functions. How should I declare the variable that I am passing to it?

0 Answers  


What is msil in c#?

0 Answers  


Is c# the same as d flat?

0 Answers  


Is ram a heap?

0 Answers  


What are methods in C#?

0 Answers   Winsol Solutions,


Categories