Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0 Setting ObjectDataSource Select Method Programatically Setting ObjectDataSource Select Method Programatically
Previous
 
Next
New Post
4/30/2006 8:58 PM
 
 Vladan,
           I have implemented the two GridView setup, the primary GridView connected to "ObjectDataSourceCRS" shows all the records from the database. The second GridView connected to "ObjectDataSource1" should display the filtered data returned from the database. GridView2 only appears after data is bound to the GridView through the ObjectDataSource1.

I carried out another debug session and I don't know what i was seeing last week but this week it would look like it is only returning the first value (whilst stepping through it's the only one that it to show) in the list of possible values (should be 5 values).

I have reposted the HTML code below.
<Start HTML Code>
<%@ Control language="vb" Inherits="HomeProd.Modules.Tmgr_CourseType.ViewTmgr_CourseType" CodeFile="ViewTmgr_CourseType.ascx.vb" AutoEventWireup="false" Explicit="True" %>
<%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>
<table cellspacing="0" style="text-align: left">
    <tr>
        <td>
            <p align="center">
                <font color="maroon" size="4"><strong>Filter On</strong></font>
            </p>
        </td>
        <td>
            <p align="center">
                <font color="maroon" size="4"><strong>Text to Filter On</strong></font>
            </p>
        </td>
        <td>
        </td>
    </tr>
    <tr>
        <td>
            <div align="center">
                <asp:DropDownList ID="DDLCol" runat="server">
                    <asp:ListItem></asp:ListItem>
                    <asp:ListItem>CourseID</asp:ListItem>
                    <asp:ListItem>CourseName</asp:ListItem>
                    <asp:ListItem>Vendor</asp:ListItem>
                </asp:DropDownList></div>
        </td>
        <td>
            <div align="center">
                <asp:TextBox ID="txtFilter" runat="server" Width="129px"></asp:TextBox></div>
        </td>
        <td>
            &nbsp;
            <asp:Button ID="btnFilter" runat="server" OnClick="btnFilter_Click" Text="Filter" />
            &nbsp;<asp:Button ID="btnClear" runat="server" OnClick="btnClear_Click" Text="Reset" />
            &nbsp;</td>
    </tr>
</table>
&nbsp;&nbsp;&nbsp;&nbsp;
<table>
    <tr>
        <td>
<asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="Vertical" AllowPaging="True" AutoGenerateColumns="False" Font-Size="Smaller" DataSourceID="ObjectDataSourceCRS" OnPageIndexChanging="gridView1_PageIndexChanging">
    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <RowStyle BackColor="#EFF3FB" />
    <EditRowStyle BackColor="#2461BF" />
    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <AlternatingRowStyle BackColor="White" />
    <Columns>
        <asp:BoundField DataField="CourseID" HeaderText="CourseID" SortExpression="CourseID" >
            <HeaderStyle ForeColor="White" />
        </asp:BoundField>
        <asp:BoundField DataField="CourseName" HeaderText="CourseName" SortExpression="CourseName" >
            <HeaderStyle ForeColor="White" />
        </asp:BoundField>
        <asp:BoundField DataField="CourseVendor" HeaderText="CourseVendor" SortExpression="CourseVendor" >
            <HeaderStyle ForeColor="White" />
        </asp:BoundField>
        <asp:BoundField DataField="ModuleID" HeaderText="ModuleID" SortExpression="ModuleID" Visible="False" />
        <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" Visible="False" />
    </Columns>
</asp:GridView>
        </td>
        <td style="width: 20px">
        </td>
        <td>
<asp:GridView ID="GridView2" runat="server" AllowPaging="True" AutoGenerateColumns="False"
    CellPadding="4" DataSourceID="ObjectDataSource1" Font-Size="X-Small" ForeColor="#333333"
    GridLines="Vertical">
    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <Columns>
        <asp:BoundField DataField="CourseID" HeaderText="CourseID" SortExpression="CourseID">
            <HeaderStyle ForeColor="White" />
        </asp:BoundField>
        <asp:BoundField DataField="CourseName" HeaderText="CourseName" SortExpression="CourseName">
            <HeaderStyle ForeColor="White" />
        </asp:BoundField>
        <asp:BoundField DataField="CourseVendor" HeaderText="CourseVendor" SortExpression="CourseVendor">
            <HeaderStyle ForeColor="White" />
        </asp:BoundField>
        <asp:BoundField DataField="ModuleID" HeaderText="ModuleID" SortExpression="ModuleID"
            Visible="False" />
        <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" Visible="False" />
    </Columns>
    <RowStyle BackColor="#EFF3FB" />
    <EditRowStyle BackColor="#2461BF" />
    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <AlternatingRowStyle BackColor="White" />
</asp:GridView>
        </td>
    </tr>
</table>
<asp:ObjectDataSource ID="ObjectDataSourceCRS" runat="server" TypeName="HomeProd.Modules.Tmgr_CourseType.Tmgr_CourseTypeController" OldValuesParameterFormatString="original_{0}" SelectMethod="GetTmgr_CourseTypes">
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
    SelectMethod="GetTmgr_FltTraining" TypeName="HomeProd.Modules.Tmgr_CourseType.Tmgr_CourseTypeController">
    <SelectParameters>
        <asp:ControlParameter ControlID="txtFilter" Name="CourseID" PropertyName="Text" Type="String" DefaultValue="" />
    </SelectParameters>
</asp:ObjectDataSource>

<End HTML Code>

Regards..
Peter.
 
New Post
5/2/2006 3:08 AM
 

Ok I must admit that I'm not sure if we are on the right track...

if you divide the application to layers (although layers-wise this is incorrect - but correct for our discussion):

1. Database query
2. SqlDataProvider
3. Controller
4. Code-behind of the control (call it manually with some params to emulate manual binding)
5. Binded on the GridView

can you confirm for each level that you get the correct 5 records (we need to figure out where it get's stuck) - where is the exact problem.

 


Thanks,
Vladan Strigo
NETMedia

My website: Vladan.Strigo.NET

Vladan.Strigo.NET: Projects
* Advanced VS2005 development approach - BlankModule
* DNN & Microsoft Ajax best practices guidance

Vladan.Strigo.NET: Resources
* Comprehensive list of DNN 4 Module development resources

 
New Post
5/3/2006 1:01 AM
 
Vladan,
            I have resolved my problem, sometimes it seems one just overlooks the obvious..

I found that in my Tmgr_CourseTypeController Class file I had incorrectly coded the DataBase call and it was returning a single object instead of a list of objects. Correcting this call has fixed my problem and it now returns as expected.

Below is what I had and then ewhat it should have been...

<incorrect Code>
        Public Function GetTmgr_FltTraining(ByVal CourseID As String)  As Tmgr_CourseTypeInfo

            'Return CType(CBO.FillObject(DataProvider.Instance().GetTmgr_FltTraining(CourseID), GetType(Tmgr_CourseTypeInfo)), Tmgr_CourseTypeInfo)
        End Function
<end Incorrect Code>

<Correct Code>
         Public Function GetTmgr_FltTraining(ByVal CourseID As String) As List(Of Tmgr_CourseTypeInfo)
            Return CBO.FillCollection(Of Tmgr_CourseTypeInfo)(DataProvider.Instance().GetTmgr_FltTraining(CourseID))
        End Function

<end correct Code>
 
New Post
5/3/2006 2:49 AM
 

Great! The devil lies in the details

anyway, glad you solved your problem.


Thanks,
Vladan Strigo
NETMedia

My website: Vladan.Strigo.NET

Vladan.Strigo.NET: Projects
* Advanced VS2005 development approach - BlankModule
* DNN & Microsoft Ajax best practices guidance

Vladan.Strigo.NET: Resources
* Comprehensive list of DNN 4 Module development resources

 
New Post
5/3/2006 6:32 AM
 
Vladan,
               I would also like to take this oportunity to thank you for your assistance.

Regards..

Peter
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0 Setting ObjectDataSource Select Method Programatically Setting ObjectDataSource Select Method Programatically


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out