I'm trying to make my form look pretty, but the datagridview refuses to play nice.
For the love of god what properties/methods allow me to select and highlight a row.
I'm trying to make it so when my mouse moves over a row it highlights. I'm using:
private
void dataGridView1_CellMouseMove(object sender, DataGridViewCellMouseEventArgs e)and hoping to pass the rowIndex to be selected through e.RowIndex.
Thanks
Praveen KumarPosted May 28, 2009, 12:09 AM
Hi,
Add the attribute in the rowdatabound event of the gridview for each datarow.
e.Item.Attributes.Add("onmouseover", "this.style.backgroundColor='#f6f6f6'");
e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='white'");
Niradhip ChakrabortyPosted May 27, 2009, 7:47 PM
check out:
1.http://geekswithblogs.net/dlussier/archive/2005/12/14/63142.aspx
2.http://www.dotnetspider.com/resources/3763-Highlight-Datagrid-or-GridView-row-mouse-over.aspx