Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I program a 'click' on a datagridview

Status
Not open for further replies.

johnc83

Technical User
Joined
Jan 29, 2008
Messages
154
Location
GB
Hi all,

could someone tell me if this is possible please..

I have a bound datagridview and underneath it are bound textboxes with the same fields. Idea is user clicks on particular row and the boxes react so he can make edits there.

A problem I am having is that when I fill the datagrid for the first time, the boxes don't fill. I am forced to click a different row and then click back on the first one for the textboxes to populate.

Is there a way I can program this so user doesn't have to manually do it?
Thanks
John

.NET 2.0, Visual Studio 2005, SQL Server 2005 Express
 
MyDataGrid.Rows(0).Selected = True
 
There's an easier one that will deal with this.
How are you currently loading the text boxes?
I normally rig up my datagrid to the textboxes by handloading the textboxes through the datagrid SelectionChanged event. This fires when the grid gets loaded and each time they click a different row. I usually set my selection to only 1 row, unless i have other things taht they can do with multiple rows. Then i have to check for multiples selected.

-Sometimes the answer to your question is the hack that works
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top