I'm making a datagridview, inside datagridview got many columns. 1 of column name is Finished(checkbox). When load form, the system will detect Finished is Checked and display color.

But when I click column header to sort, it will not display color. So how I set color command in column header in datagridview?

Recommended Answers

All 3 Replies

Create an event when datagridview sorts the data,

private void dataGridView1_Sorted(object sender, EventArgs e)
{
   //your logic to change the column header color..
}

thanks for reply.
I'm find solution already.

private void dataGridView1_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.