We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Deleting a row in a main table so that all related rows in a foreign table are deleted as well

Thread ID:

Created:

Updated:

Platform:

Replies:

31106 Jun 30,2005 05:09 AM Jun 30,2005 08:21 AM Windows Forms 3
loading
Tags: GridControl
Thabo
Asked On June 30, 2005 05:09 AM

Hi i''m using a GridGroupingControl in my application. I have two tables, namely: Users and Areas. The userID is a foreign key in the Areas table. A user can be assigned to multiple areas. In my GGC grid i have two display columns namely: UserName and AssignedAreas. the AssignedAreas column has a dropdown list containing diffent areas a user can be assigned to. next to each area is a checkbox. if the checkbox is checked, it means the user is assigned to that area. if the checkbox is unchecked, it means the user is not assigned to that area. the realtional table relating the user and area has to be automatically updated when a checkbox is checked or unchecked. The problem i''m having is that when i have a user assigned say to 4 areas and i uncheck one of the areas so that the user is now assigned to 3 areas, the relational table doesn''t delete the row which has the user and the area i just unchecked. Another problem i have is that if i delete a user i.e. one row, the relational table doesn''t delete all rows that contain the user i just deleted. Regards David

Administrator [Syncfusion]
Replied On June 30, 2005 06:09 AM

I do not fully understand what you are descriing an dhow you are trying to implement it. Are you using standard CellTypes to try to do this? Or are you using some kind of dropped CheckBoxList control to manage this? Do all users have the same dropdown, and it is only that checked columns that differ from user to user in the dropdowns? Or, do the droplist content differ from user to user. Can you upload a sample that show the problem you are having? Or maybe upload some screen shots illustrating what you are doing and what the problems are?

Thabo
Replied On June 30, 2005 07:55 AM

>I do not fully understand what you are descriing an dhow you are trying to implement it. > >Are you using standard CellTypes to try to do this? Or are you using some kind of dropped CheckBoxList control to manage this? > >Do all users have the same dropdown, and it is only that checked columns that differ from user to user in the dropdowns? Or, do the droplist content differ from user to user. > >Can you upload a sample that show the problem you are having? Or maybe upload some screen shots illustrating what you are doing and what the problems are? > Hi, All Users have the same dropdown. It is only the checked columns that differ from user to user. e.g. Assuming a dropdownlist has the values New York and Paris, user 1 can have the areas New York and Paris checked in their dropdownlist, and user 2 can have only Paris checked in their dropdownlist. In the relational table we will have the following values: USER AREA 1)user1 New York 2)user1 Paris 3)user2 Paris Now if, i decide to uncheck New York in user 1''s row, the changes should be reflected in the relational table that stores the relations i.e. in the underlying table, a row containing user1 and New york should be deleted. The Relational table should now look like: USER AREA 2)user1 Paris 3)user2 Paris I believe i should use some event handler that checks when a value in a checkbox is checked or unchecked. The attached file explains thoroughly. Regards David

Administrator [Syncfusion]
Replied On June 30, 2005 08:21 AM

Your attachment did not make it. You can try again here or you can send it to support@syncfusion.com and mention this forum thread in the subject. Another option would be to log a Direct Trac support incident and include the information there. Are yuou trying to use a custom cell control like the one in this sample? \Syncfusion\Essential Studio\3.2.1.0\Windows\Grid.Windows\Samples\In Depth\DropDownFormAndUserControlSample If so, that sample uses a comma delimited list to track the checked information. You could probably modify the child table in a similar manner to track the checked information.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;