Windows Develop Bookmark and Share   
 index > Windows Forms Designer > datagridview help
 

datagridview help

I preparing an application using datagridview having datagridviewTextbox. The requirment of this application is that when the application first loads the datagrid view should not have any cell selected. the datagridview by default selects the uppermost left cell as selected. How can i have no cell selected in the beginning. I tried to set FirstDisplayedCellproperty for the purpose but to no avail.

KiranK  Thursday, June 08, 2006 7:17 AM
Use DataGridView.ClearSelection().
Hope this helps...
Moayad Mardini  Thursday, June 08, 2006 7:28 AM

I did try ClearSelection on form load but the highlight was still there on the upper left corner. Is there any event which can be called after form load to deselect all cells or to set FirstDisplayed cell as null

KiranK  Thursday, June 08, 2006 8:29 AM

Try setting dgv.CurrentCell to Nothing but beware of the following:

"You can set this property to a null reference (Nothing in Visual Basic) to temporarily remove the focus rectangle, but when the control receives focus and the value of this property is a null reference (Nothing in Visual Basic), it is automatically set to the value of the FirstDisplayedCell property. "

Hope this helps...

Matty4242  Friday, June 09, 2006 3:20 PM

You can use google to search for other answers

Custom Search

More Threads

• Visual Studio 2005 Forms Designer Bugs
• Create a new ControlCollection in a Form in c#
• Adding controls to a GroupBox hosted inside a UserControl
• No reset
• Nasty drop down border of Combo
• Tabcontrol - bug(?) when pasting components on it
• How to let application override event handler in User Control?
• Control properties locked for inherited forms
• Re-evalute CanExtend method?
• How to diplay a pie chart on Windows form?