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 master pages how to use it. plase give one example in code vice

1 Answers  


Are c# references the same as c++ references?

0 Answers  


What is Serialization and how do we implement (in real time scenario)

1 Answers  


what is application domain?

4 Answers   Kanbay,


what is a callback function?

4 Answers  






Wht executescaler method is used?

0 Answers  


State whether it is true to test a Web service you must create a windows application or Web application to consume this service or not?

0 Answers   Siebel,


What is delegate in c# interview questions?

0 Answers  


What are the ways to deploy an assembly?

2 Answers   Siebel Systems, Visual Soft,


Explain partial class in c#?

0 Answers  


Can we make a Static Constructor Parameterized? Give Reason with your answer

0 Answers  


6. If we assign a value in textbox on Page_UnLoad event, will it display?

2 Answers   Mphasis,


Categories