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

What is deferred execution?

0 Answers  


What are the two kinds of properties?

10 Answers   Wipro,


Why do we need dependency injection in c#?

0 Answers  


What is difference between ilist and list in c#?

0 Answers  


Suppose two interfaces have same method, so how will you implement these methods in derive class?

0 Answers  






What is argument in c#?

0 Answers  


Is c# strongly typed?

0 Answers  


Do unused Namespaces in c# affect run-time performance?

0 Answers   HCL,


What are data types in C#?

0 Answers   TryTechnicals Pvt Ltd,


What is a three-tier application.

0 Answers   Siebel,


what is virtual method in c#?

0 Answers  


List the 5 different access modifiers in c#?

0 Answers  


Categories