Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to connect input controls to GridView selected recor
Message
From
01/06/2006 01:15:57
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, California, United States
 
 
To
31/05/2006 18:24:02
Rex Mahel
Realm Software, Llc
Ohio, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01125589
Message ID:
01126386
Views:
14
1. I would add a property of type YourBusinessObj to the form to facilitate referencing the object later:
YourBusinessObj _YourObj;
2. In the constructor, before InitializeComponents(), add a call to register your business object with the form:
this._YourObj = (YourBusinessObj)this.RegisterBizObj(new YourBusinessObj());
3. Again, in the constructor, this time after InitializeComponents(), add a call to whatever method you've already setup that is going to pull the data and set the navigation controls to synchronize with your DataGridView:
this._YourObj.PullMyData();
this.NavigationControl = this.dgvYourDataGridView;
4. In the property sheet for your grid, BindingSource should be set to "YourBusinessObj"
5. For your textboxes, BindingSource is "YourBusinessObj" and BindingSourceMember is the field name from the DataTable you're pulling in PullMyData() that you want to display in the textbox.

There's a couple other properties to set for ComboBoxes and ListBoxes. You'll probably want to look at the devguide for those. Don't remember them off the top of my head, but this should get you going.

Oh yeah, as far as YourBusinessObj is concerned, just be sure that in addition to creating a method to pull your data, you have this.TableName populated (by default it's usually the name of the back-end table), and that you have a valid DatabaseKey (usually inherits from ABusinessObject and is set up by the project wizards) that matches what's in your app.config.

Hope that helps,
---J

>Actually, the quicker the better
>
>Thanks
>
>>Hello, Rex
>>
>>As long as you're using mmDataGridView(assuming you're using 2.0 or greater), it should "just work" if you follow the devguide. Is it not working for you or are you looking for some quick code to get you up and running?
>>
>>---J
>>
>>>All,
>>>
>>>I have a page containing a GridView and input controls that I want to populate for the selected record in the GridView. How can I do this?
>>>
>>>TIA
Previous
Reply
Map
View

Click here to load this message in the networking platform