Probelm showing Manually Created BO in devexpress Grid


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
I am having  a problem displaying fields in a Devex Grid. The only fields that will diplay, are the Original Fields from my Main Table BO

I want to select out different fields from a few joined Tables and display them in  Grid. For this purpose , I have set up a Dummy BO, with just two fields, and I use this as a sort of Repository to hold the fields I select out. So say my Dummy Table (And BuisnessObject) has just 2 fields D01_pk and D01_Val1.

The only purpose of the Dummy Table is to be able to join the fields and end up with one Table, but the only fields I can get to display are the fields from the original Source BO (In my case just 2 fields). All other fields just show blanks, even though the Business Object populated with the correct count of rows.

I have the following code in the Load of the form (I cannot assign the BBS to a business object on the form parameters as I have not yet created the BusinessObject, this is why I am setting the BusinessObject to the BBS in the Form Load)

Kernel_BOLibrary.XBO myBO = new XBO();        // My Dummy Business Object whcih I use to JOin other Tbales into
SqlCommand comm = new SqlCommand();
comm.CommandText = "Select 1 as D01_PK,'XXX' as D01_Val1,  MyField1,MyField2,MyField3 from TABL1 join TABL2 on X=Y ";
myBO.Clear();
myBO.FillDataTable(comm);
bbsPost.BusinessObject = myBO;
gridPost.DataSource = bbsPost;


So in the Grid, DO1_Pk and D01_Val1 display fine, but I cannot get the other fields, which I have joined (MyField1,MyField2,Myfield3) to display


Replies
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi Edhy, many thanks for your comments, and if you have the time, I would like to flesh this out  a little more, as I want to end up doing things in a standard way.

Say I have 50 screens in my app (in the process of being designed right now) , and each screen will access possibly 10 tables.

Altogether, the App would use say 30 tables, whcih translates into 30 BusinessObjects. For a lot of my Forms, they are not really maintenance Forms, but Processing Type forms, where I want to display data from a number of joined tables, and if say a particular Row is ticked, do something

So, I would have the following Scenario:

Form1:  Select * from Table1 join Table2 join Table3

Form2:  Select * from Table4 join Table5 Join Table6

Form3:  Select * from Table7 Join Table8 Join Table9

etc for my 50 screens, so yes,  I do know the fields in advance ,and I will want each field from myselect to end up on a Grid in the Form

 Do I then have to set up 50 different Views ? I have read in a few places that setting up views may not be the most elegant way of doing things, partcicularly when the ONLY purpose of the view is to get over the limitiation that I cannot place all the fields from a BBS onto a Grid.

(Obviously for my day to day maintenance and Data Entry Forms, I use bog standard Business Objects and thet work well)
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Ger Cannoll (2/10/2012)
Hi Edhy, many thanks for your comments, and if you have the time, I would like to flesh this out  a little more, as I want to end up doing things in a standard way.

You are welcome Ger. 
I am currently working on final touches of an update, but there is always some time for the SF community.  I sent you a Private Message with some info, after that you can post your final decision here.

Edhy Rijo

Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
I have this working now satisfactorily, as follows:

1. In the Load Event , and a 'Refresh' button, I have a Call to code that Creates a BO (Which includes a Few Joins to other Tables). I am using a Base Generic type Bo, which I will use for all instances like this where I need to join a few tables

2. I have a Devexpress grid set up, and in Code, set the DataSource of the Grid to the Underlying DataTable in the BO. Doing this, I can see all the fields in the DataTable

3. I then can use the BO.GetEnumeraable  to Process the data from the Grid  (Any changes done in the Grid are rfelected in the underlying DataTable, and also on the BO)

4. I am not using a BBS, but this has not caused any particular issues as all Grid Changes are reflected in the BO anyway.

Many thanks for all assistance
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Ger Cannoll - 13 Years Ago
Edhy Rijo - 13 Years Ago
Ger Cannoll - 13 Years Ago
Edhy Rijo - 13 Years Ago
Ger Cannoll - 13 Years Ago
                         If you wrap your BO in a business binding source, then attach the grid...
Trent L. Taylor - 13 Years Ago
                             Hi Trent. Thanks for replying. My initial route was to go with the...
Ger Cannoll - 13 Years Ago
                         Hi Gen, So as you said, if by changing the casing of the field names...
Edhy Rijo - 13 Years Ago
                             Hi Edhy [quote].....So as you said, if by changing the casing of the...
Ger Cannoll - 13 Years Ago
                                 Hi Ger, No problem I understand now. Well, since your need is to...
Edhy Rijo - 13 Years Ago
                                     HI Edhy. I thought of doing something like this, but what I want to...
Ger Cannoll - 13 Years Ago
                                         [quote][b]Ger Cannoll (2/10/2012)[/b][hr]Being able to select out...
Edhy Rijo - 13 Years Ago
                                             Hi Edhy, many thanks for your comments, and if you have the time, I...
Ger Cannoll - 13 Years Ago
                                                 [quote][b]Ger Cannoll (2/10/2012)[/b][hr]Hi Edhy, many thanks for your...
Edhy Rijo - 13 Years Ago
                                                     I have this working now satisfactorily, as follows: 1. In the Load...
Ger Cannoll - 13 Years Ago
Trevor Hendricks - 13 Years Ago
Ger Cannoll - 13 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search