Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Disabling DataGrid cell highlight
 

Disabling DataGrid cell highlight

Hi,

I'm am trying to solve this problem for a month!!!
I want that all the cells would'nt be highlighted at any time...

I Tried this code:

public class dgInherit : System.Windows.Forms.DataGrid

{

protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)

{

DataGrid.HitTestInfo hitTestInfo = this.HitTest(e.X, e.Y);

if ( hitTestInfo.Type == HitTestType.Cell)

{

return;

}

if (hitTestInfo.Type == HitTestType.ColumnResize)

{

return;

}

if (hitTestInfo.Type == HitTestType.RowResize)

{

return;

}

base.OnMouseDown(e);

}

protected override void OnEnter(EventArgs e)

{

}

}

I thaught that i solved the problem... But There is a new one.
When i'm using the scroll bars then the first cell in the row is highlighted!!!

PLZ Help me...

:-( BogN

BogN  Saturday, November 12, 2005 3:48 PM
Check out the SyncFusion FAQ: http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c44c.aspx#q855q

-mark
Program Manager
Microsoft
This post is provided "as-is"
Mark Rideout  Thursday, November 24, 2005 2:24 AM
Someone? please help me...SadTongue Tied
BogN  Sunday, November 13, 2005 9:09 PM
Check out the SyncFusion FAQ: http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c44c.aspx#q855q

-mark
Program Manager
Microsoft
This post is provided "as-is"
Mark Rideout  Thursday, November 24, 2005 2:24 AM

There are some very good techniques on that site. However, I can't seem to solve the highlight problem and enable doubleclick on the cell at the same time.

It seems like all of these methods only allow for the handling of a single click.

creagan  Friday, March 10, 2006 7:16 PM

You can use google to search for other answers

Custom Search

More Threads

• Event handling
• error: Unbound reference in aggregate expression
• Simple binding c# 2005 very strange problem (bet you cant solve it!)
• DataGridView ComboBox Column Problem
• INSERT Statement conflicts with ForeignKey Constraint
• TextBox Validation
• See a row that is selected if it's below the the visible rows
• Select a datagrid cell value?
• How do I fire the RowEnter event in a datagridview?
• Capture data from datagridview with a click of a button