Guys, i have been struggling with this for past three days...

here is what i have...

aspx page

<form id="Form1" method="post" runat="server">
<asp:repeater id="titleRepeater" runat="server" EnableViewState="False">
<b><%# DataBinder.Eval(Container.DataItem,"Item_No") %>
<asp:DataGrid ID="maingrid" Runat="server" AutoGenerateColumns=True DataSource='<%# GetDataSource( Container.DataItem )%>' OnItemDataBound="maingrid_showformatting" ShowFooter=True >


Private MyDataset As New DataSet
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not Page.IsPostBack Then
        End If
    End Sub
Private Sub BindGrid()
        Dim strConnection As String
        strConnection = "conn string here"
        Dim objConnection As OleDbConnection
        objConnection = New OleDbConnection(strConnection)
        Dim StrSQL As String = "sql 1 here"

        Dim strSQL1 As String = "sql 2 here"

        Dim objDa As OleDbDataAdapter
        Dim objDa1 As OleDbDataAdapter
        objDa = New OleDbDataAdapter(StrSQL, objConnection)
        objDa1 = New OleDbDataAdapter(strSQL1, objConnection)

        objDa.Fill(MyDataset, "Parent")
        objDa1.Fill(MyDataset, "Child")

        titleRepeater.DataSource = MyDataset.Tables("Parent")
    End Sub

 Public Function GetDataSource(ByVal dataItem As Object) As DataView
        Dim intNo As String = DataBinder.Eval(dataItem, "Item_No")
        Dim dv As DataView = MyDataset.Tables("Child").DefaultView
        dv.RowFilter = "Item_No='" & intNo & "'"
        Return dv
    End Function
Sub maingrid_showformatting(ByVal sender As Object, ByVal e As DataGridItemEventArgs)
'some formatting here
end sub

everything works fine...but i want to add subheader and break messages to the child datagrids that are created for the each repeater item...i am not sure how to reference them...here is what i am trying to add...the below is the code i have for a datagrid without repeater and works fine...but now i want to do the same thing for each datagrid inside repeater...

Dim row As TableRow
        Dim i As Integer = 0

        Do While i <= ds.Tables(0).Rows.Count - 2
            If ds.Tables(0).Rows(i).Item("calcLength") Is DBNull.Value Then
                    Dim shRow As DataRow = ds.Tables(0).NewRow
                    shRow("Station") = "Subheading"
                    ds.Tables(0).Rows.InsertAt(shRow, i + 1)
                    i = i + 1
                Dim eRow As DataRow = ds.Tables(0).NewRow
                eRow("calclength") = ds.Tables(0).Rows(i).Item("calcLength")
                eRow("calcAve_Width") = ds.Tables(0).Rows(i).Item("calcAve_Width")
                eRow("calcSF") = ds.Tables(0).Rows(i).Item("calcSF")

                ds.Tables(0).Rows.InsertAt(eRow, i + 1)
                i = i + 1
            End If
            i = i + 1
        'End inserting break message

        mydg.DataSource = ds

can some please assist me with this...

11 Years
Discussion Span
Last Post by Eclipse414
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.