Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nested Datagrid Question

Status
Not open for further replies.

teferi2002

Technical User
Sep 24, 2005
81
US
I am trying to creat a datagrid within a datagrid using the blelow code.I managed to get the result for the parent datagrid and for some reason i am not able to get a reuslt for the child (the iner datagrid).I have spent hours working on it and do not know what to think to make it work.can someone look at and help me fixing this code.I really appreciate your help and time.

I just do not get any result for

<asp:BoundColumn DataField="VENDOR" HeaderText="Vendor Id"></asp:BoundColumn>


<%@Page Language="VB" EnableViewState="False" Debug="True" %>
<%@Import Namespace="System.Data" %>
<%@Import Namespace="System.Data.OleDb" %>

<Html>
<Head><Title>Bid Result</Title></Head>

<Script runat="server" language="VB">

Sub Page_Load()

'and in the code behind,
'this goes in the PageLoad

dgMaster.DataSource = GetAuthors()
dgMaster.DataBind()

End Sub


' and this is separate
Function GetAuthors() As DataTable


Dim conn As New OleDbConnection("provider=MSDAORA;Data Source=tplp;User ID=tplcp;Password=tplcp;")
Dim strSQL As String
Dim ds As New DataSet()


strSQL = "SELECT call, letting FROM letprop where letting ='05121601' ORDER BY call"
Dim da As New OleDbDataAdapter(strSQL, conn)
da.Fill(ds,"tblAuthors")
Return ds.Tables("tblAuthors")

End Function




Function GetDetails(ByVal x As String)


Dim conn As New OleDbConnection("provider=MSDAORA;Data Source=tplp;User ID=tplcp;Password=tplcp;")
Dim strSQL As String
Dim ds As New DataSet()



strSQL = " SELECT DISTINCT b.VENDOR, b.CALCBTOT,V.VNAMEL,B.CALL,L.LCONTID FROM LETPROP L , BIDDERS B , VENDOR V WHERE L.LETTING = B.LETTING AND L.CALL = B.CALL AND V.VENDOR = B.VENDOR AND L.LETTING = '05121601' and B.call ='X' "

Dim da As New OleDbDataAdapter(strSQL, conn)
da.Fill(ds,"tblDetails")
Return ds.Tables("tblDetails")

End Function

</Script>

<Body>

<form runat="server">


<asp:datagrid runat = server id=dgMaster autogeneratecolumns="False" width="100%" >
<columns>
<asp:BoundColumn HeaderText="Job Details" DataField=call></asp:BoundColumn>

<asp:TemplateColumn HeaderText="Bid Result Summary" >


<ItemTemplate>

<asp:DataGrid runat = server id=dgDetails width="100%" halign="center"
DataSource = <%# GetDetails(container.dataitem("call"))%>
AutoGenerateColumns=false>

<Columns>
<asp:BoundColumn DataField="VENDOR" HeaderText="Vendor Id"></asp:BoundColumn>
<asp:BoundColumn DataField="VNAMEL" HeaderText="Vendor Name"></asp:BoundColumn>
<asp:BoundColumn DataField="CALCBTOT" HeaderText="Bid Result"></asp:BoundColumn>

</Columns>
</asp:DataGrid>


</ItemTemplate>
</asp:TemplateColumn>
</columns>
</asp:datagrid>

</form>

</Body>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top