plz help me.....
I want to disable current row of Datagrid after clicking button....
plz give the code for that....
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kirtan PatelPosted Aug 17, 2009, 6:36 AM
You Accomplish your task by Below Code Set Read-only Property of Row to True
and Change the back ground and Fore Ground Color to be Gray
so it will indicate user that row is disabled or read only :)
Friend , dont forget to mark "Do you like answer" it will give me some credits :)
and let me know if you are having any difficulties to implement the code :) i will assist you :)
private void button1_Click(object sender, EventArgs e)
{
//Index of Row You want to Disable Here we Disabling 2nd Row
int RowIndex = 1;
// Set Rows Readonly Property to True
dataGridView1.Rows[RowIndex].ReadOnly = true;
//Change The Back Color so it will Simulate Disable
dataGridView1.Rows[RowIndex].DefaultCellStyle.BackColor = Color.Gray;
//Change the For Color White
dataGridView1.Rows[RowIndex].DefaultCellStyle.ForeColor = Color.White;
}