LLBGen Data Source control with oBout master/detail grid

Posts   
 
    
Posts: 11
Joined: 29-Oct-2008
# Posted on: 27-Feb-2009 21:25:10   

Hi Support,

Environment: VS2005, Vista, LLBGenPro v2.6 Runtime v2.0.50727, SQL Express 2005, oBout Grid V5.0

I'm using the oBout grid on a web page to show master/detail grids. I have two LLBLGen Pro datasource controls, one for the master entity collection, the other the detail entity collection. The entity collections are related with primary/foreign keys.

I can bring up the master grid data OK. I cannot get the detail grid to show any data.

If I set the default value of the Detail LLBgen control select parameter to a known value eg.

<SelectParameters>
    <asp:Parameter Name="PoolNo" type="string" DefaultValue="PL714" />
</SelectParameters>

then I get all the related detail for that item in the detail grid OK. So I believe the data sources are OK and the grid is calling the LLBGen datasource control.

There appears to be a problem with the passing the parameters to the detail LLBgen control by the oBout control. To pass the parameter(s) the oBout control uses a "ForeignKeys" tag which identifies which detail items to fetch. This mechanism appears to be where the problem lies. Code for the page is below. Can you please advise?

regards Colin...

======================================

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="MasterDetail.aspx.vb" Inherits="TestWeb.MasterDetail" %>

<%@ Register Assembly="SD.LLBLGen.Pro.ORMSupportClasses.NET20" Namespace="SD.LLBLGen.Pro.ORMSupportClasses"
    TagPrefix="llblgenpro" %>

<%@ Register Assembly="obout_Grid_NET" Namespace="Obout.Grid" TagPrefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <link display="all" href="mvwres:2-obout_Grid_NET.resources.styles.grand_gray.style.css,obout_Grid_NET, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5ddc49d3b53e3f98"
        rel="stylesheet" type="text/css" />
    <link display="all" href="mvwres:2-obout_Interface.OboutTextBox.resources.styles.grand_gray.style.css,obout_Interface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d5dff6913a9d6649"
        rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
        &nbsp;<llblgenpro:LLBLGenProDataSource ID="LLBLGenProDataSource1" runat="server"
            DataContainerType="EntityCollection" EntityCollectionTypeName="pat.danks.com.au.CollectionClasses.PatPoolCollection, pat.danks.com.au" CacheLocation="Session">
        </llblgenpro:LLBLGenProDataSource>
        <llblgenpro:LLBLGenProDataSource ID="LLBLGenProDataSource2" runat="server" DataContainerType="EntityCollection"
            EntityCollectionTypeName="pat.danks.com.au.CollectionClasses.PatLayoutCollection, pat.danks.com.au" CacheLocation="Session">
            <SelectParameters>
                <asp:Parameter Name="PoolNo" type="string" />
            </SelectParameters>
        </llblgenpro:LLBLGenProDataSource>
        
        
        <cc1:Grid ID="Grid1" runat="server" DataSourceID="LLBLGenProDataSource1">
            <Columns>
                <cc1:Column id=PoolNO DataField=PoolNo></cc1:Column>
                <cc1:Column id=POOLNAME DataField=PoolName width=500></cc1:Column>
            </Columns>
            <MasterDetailSettings LoadingMode=OnCallback />
            <DetailGrids>
                <cc1:DetailGrid ID="DetailGrid1" runat="server" DataSourceID="LLBLGenProDataSource2" ForeignKeys="PoolNo">
                    <Columns>
                        <cc1:Column id=Column2 DataField=PoolNo></cc1:Column>
                        <cc1:Column id=Column1 DataField=PageNo></cc1:Column>
                     </Columns>
                 </cc1:DetailGrid>
            </DetailGrids>
         </cc1:Grid>

    </form>
</body>
</html>

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 02-Mar-2009 17:34:49   

Sorry for the late reply. Your post was accidently added to the lower priority queue flushed

Your runtime library version is the .NET version. Please see the guidelines thread in this forum how to obtain the runtime lib build nr. it's important that we know that number so we can check whether you're running into an issue that was already fixed for example.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 11
Joined: 29-Oct-2008
# Posted on: 02-Mar-2009 23:50:50   

The LLBGen runtime is 2.6 final (August 18th 2008 ). Mouse hover on LLBGenProDataSource control in the VS Tool box shows 2.6.0.0

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 03-Mar-2009 09:51:08   

Your selectParameter should point to the selected value from the Parent Grid.

It should look like:

<SelectParameters>
        <asp:ControlParameter ControlID="Grid1" PropertyName="SelectedValue" Name="Id"></asp:ControlParameter>
</SelectParameters>
Posts: 11
Joined: 29-Oct-2008
# Posted on: 11-Mar-2009 01:13:59   

I have cross posted this with oBout support, they too a while to get back to me. They wanted me to try:

            <SelectParameters>
            <asp:Parameter Name="PoolNo" Type="String" />
            </SelectParameters>

Which doesn't give any errors, or any data. If I set the defaultvalue with this scenario I do get data, but only for the default value of course.

If I use the following code:

        <SelectParameters>
        <asp:ControlParameter ControlID="Grid1" Name="PoolNo" 
                PropertyName="SelectedValue" Type="String" />
        </SelectParameters>

I get the following error -

DataBinding: 'Obout.Grid.Grid' does not contain a property with the name 'SelectedValue'.

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 11-Mar-2009 08:49:11   

Then you should ask them this: Which property of your grid control, can give me the value of the PK of the selected row?

JayBee
User
Posts: 282
Joined: 28-Dec-2006
# Posted on: 27-Mar-2009 07:52:15   

I'm experimenting with the Obout grid. I use it to display a TypedList.

The property SelectedRecords represents a hashtable that holds the data of one or more selected records. When you add the Id to the data presented, and specify that the column holding this data should not be displayed, in the Select event you can retrieve the Id from the hashtable.

I'm not sure if this is the best way, but it works fine.

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 27-Mar-2009 08:28:17   

Thanks for your input.

JayBee
User
Posts: 282
Joined: 28-Dec-2006
# Posted on: 21-Apr-2009 23:29:22   

This one cannot be closed yet.

The way I have set up the master-detail is with the detailgrid outside the master grid. The obout grid also allows to have a detail grid inside a mastergrid.
This is what the original poster was trying to use.

I cannot get that functionality to work too.

Regards,

Jan

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 21-Apr-2009 23:37:24   

Please can you start a new thread giving the full details of your issue, rather than hijacking this one - we can lose track of where we are if old threads are reopened.

Thanks

Matt

JayBee
User
Posts: 282
Joined: 28-Dec-2006
# Posted on: 22-Apr-2009 21:05:47   

But it is the original problem. I thought I had it solved, but that was not correct.

Posts: 11
Joined: 29-Oct-2008
# Posted on: 22-Apr-2009 22:19:24   

I gave up on using the OBout Grid. The Obout grid does not support doing a postback to fill the detail grid when using Master/Detail. I needed to intercept this and filter the records. I am now using the Janus grid. It works fine with the LLBLGen collections and controls. The only issue I have found is the Janus grid isn't able to automatically populate a heirachacal grid structure from an LLBLGen control. It works fine if you do it manualy. Which you problay want to do anyway as you usually dont want to display all the fields.