-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: databinding nhibernate
PostPosted: Tue Mar 31, 2009 6:11 am 
Newbie

Joined: Tue Mar 31, 2009 5:55 am
Posts: 4
Hi,

My project is a Winform Project.
I have a DataGridView that i have binded to a nhibernate request result.

There are my classes :


Code:
public class Priority
{
private Group group;
private int Prio;
private bool rightToModifyS;
private bool rightToModifyA;
}

public class Group
{
private String Name;
private String Firme;


My Code for the binding :


Code:
LoadingFacade LoadingF = new LoadingFacade();
bindingSourcePriorities.DataSource = LoadingF.GetPriorities();
dtgPriorities.DataSource = bindingSourcePriorities; 


The LoadingF.GetPriorites(); return a Priority objects list.

I want to see in my datagridview the "Name" and "Firm" of the Group object of the Priority object, but my datagridview shows only the "Prio", "rightToModifyS" and "rightToModifyA" fields.

Thanks for your help ?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 31, 2009 7:45 am 
Regular
Regular

Joined: Wed Feb 11, 2009 10:58 am
Posts: 55
I asked exactly the same a few topics above.

http://forum.hibernate.org/viewtopic.php?t=995991&sid=fdf6dc581d23ad01696ee7632f1cae05

The only thing that I could do was:

Code:
public class Priority
{
private Group group;
private int Prio;
private bool rightToModifyS;
private bool rightToModifyA;

public String groupName { get { return Group.Name; } set { Group.Name = value; } }
public String groupFirme { get { return Group.Firme; } set { Group.Firme = value; } }
}


This is not very nice, though I don't think there's any general approach. Hope anybody can help, cause this is something that bothers me, too.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 31, 2009 10:45 am 
Newbie

Joined: Tue Mar 31, 2009 5:55 am
Posts: 4
thanks for the solution. It works.
I saw also a framework "objectview" that can do that, did you know this framework ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 01, 2009 4:23 am 
Regular
Regular

Joined: Wed Feb 11, 2009 10:58 am
Posts: 55
No I don't know it. I'm relatively new to all those "new" techniques.

I'll have a look at it.

Thanks for the Tip!!!

Edit: Anybody got a link? I've only found this:

http://sourceforge.net/projects/objectviews/

but that doesn't look very well supported. No updates since 2006 and still alpha release.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.