Maintaining related data in a grid

Posts   
 
    
Markiemac
User
Posts: 132
Joined: 25-Apr-2006
# Posted on: 07-Jan-2008 21:13:33   

Hi, (Using Adapter V2.5/VB/SQL Server 2005/WinForm/DevEx)

I'm maintaining data from 2 tables and am interested in how other developers maintain a table with related fields in a WinForm Grid?

I use 2 related tables (tblUserRole & tblRole). tblUserRole UserID RoleID (FK related to Role table)

tblRole RoleID RoleName RoleDescription

The grid has 2 columns (RoleName & RoleDescription). It's populated with a collection of rows from tblRole, for a related tblUserRole.UserID. The RoleName column is managed via a combo (Value member: RoleID, Display member: RoleName)

Problem When I add another Role for a user on a new row, how do I also show its related description in the RoleDescription column?

I'm anxious to avoid use of an 'Add New' button + another dialogue to select the new Role, update the datasource and refresh the grid.

What options do I have to manage this in the grid itself?

Thanks for any thoughts/ideas simple_smile

goose avatar
goose
User
Posts: 392
Joined: 06-Aug-2007
# Posted on: 08-Jan-2008 00:01:47   

please see Generated code - Databinding with ASP.NET 2.0, Adapter in order to take advantage of the 2-way binding in the LLBLGenProDataSource2 control.

Markiemac
User
Posts: 132
Joined: 25-Apr-2006
# Posted on: 08-Jan-2008 13:52:57   

That's very cryptic. Do you think you/someone could be more specific?

The presentation is WinForm. I set the EntityCollection at design time then fill its BindingSource at runtime via its BL Manager.

The issue is that the 2 column grid is populated as it should be with fetched data from 2 related tables, but when I enter a new Name in column 0, I can't see how to get column 1 to display its corresponding/related Description.

Are there any DevEx XtraGrid users out there who can relate to my problem?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 09-Jan-2008 11:10:05   

When I add another Role for a user on a new row, how do I also show its related description in the RoleDescription column?

I'm anxious to avoid use of an 'Add New' button + another dialogue to select the new Role, update the datasource and refresh the grid.

What options do I have to manage this in the grid itself?

Is this question related to LLBLGen Pro? If I'm not missing something, I think that's a general question that has nothing to do with LLBLGen Pro, if I'm right, then this question should have been posted in the General Forum, so maybe you can get more DevEx XtraGrid users to help you.

Anyway I think the datasource should be refreshed/updated fo the newly inserted item to be fetched and displayed in the Grid. If you just want to display the Description before the insert takes place for the user to read it along with the name, then maybe you should append the description to the RoleName in the Combo box used to select the Role.

Markiemac
User
Posts: 132
Joined: 25-Apr-2006
# Posted on: 09-Jan-2008 12:37:43   

Whoops, wrong forum, but thanks for the suggestions.