Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GridView with Templates
Message
 
To
03/03/2010 14:56:19
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01452320
Message ID:
01452614
Views:
26
Have you registered the phones biz object as a child of the client biz object (e.g., oClient.RegisterChildBizObj(oPhones))?
I think that will take care of all that.
If that won't work for your form, then you will just need to refresh your child dataset any time you move to a new client record.

The buttons for the child grid should be separate from the grid, I would think.

To show the drop down list in the grid, you will need to write a little code. Here's what it is for Windows Forms. It should be pretty similar for a web app.
            DataGridViewComboBoxColumn dgvccColName = (DataGridViewComboBoxColumn)grdGridName.Columns["colColumnName"];
            dgvccColName.DataSource = oPhoneType.GetCurrentDataSet().Tables[oPhoneType.TableName];
            dgvccColName.ValueMember = "PhoneTypePK";
            dgvccColName.DisplayMember = "PhoneType";
I hope that helps.

>Hi,
>
>I am struggling with trying to set up a web form using a GridView to display and edit the many side of the relationship between Clients and Phones. That is, I am editing a Client record and want to display the many phones that the client can have in a grid. My table structure is like this:
>
>Client:
>ClientPK (primary key)
>Name, etc
>
>Phones:
>PhonePK (primary key)
>PhoneTypeFK (foreign key to phone type lookup)
>PhoneNumber
>ClientFK (foreign key to Client)
>
>PhoneTypes:
>PhoneTypePK (primary key)
>PhoneType (description like "Home", "Mobile", "Work", etc)
>
>I have my Client Business Object (oClient) set up and working, along with my Phone Business Object (oPhone) and my PhoneType BO (oPhoneType).
>
>On my grdPhones I have set up columns for the Edit button, the Delete button, the PhoneTypeFK (which I want to be a dropdownlist showing the Phone Type) and the phone number. I also have an Add Phone button elsewhere on the form. It currently displays OK (except that it displays the PhoneTypeFK rather than the Phone Type description).
>
>Can somebody please walk me through the setup to get this GridView to work properly?
Linda Harmes
HiBit Technologies, Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform