Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Invisible Grid
Message
From
26/05/2004 16:48:23
 
 
To
26/05/2004 10:29:35
Mindy Shingara
Central Susquehanna Intermediate Unit
Lewisburg, Pennsylvania, United States
General information
Forum:
ASP.NET
Category:
WebForms
Title:
Miscellaneous
Thread ID:
00907354
Message ID:
00907528
Views:
16
>Hi,
>I have a web DataGrid that's loaded using a custom event with records pulled from table "bp_bidod". I have the datasource on the grid set to DataSet.Tables["bp_bidod"], all my fields are bound to the correct fields in the table, and I have a record count of 8. I also do a Grid.DataBind() and still can't see my grid. I'm assuming I'm missing a minor detail here somewhere. I don't receive any errors and the page load fine. Can anyone tell me why my page will load, but my grid won't display?
>
>Thanks so much!

Maybe I over simplify, but, I was unable to get the gridpoped before I did a Page.DataBind() See code below.
    Sub BindAFTGrid()

        Try
            Dim sqlcn As New System.Data.SqlClient.SqlConnection(connection_str)
            Dim strSQL As String = "Select * from AdminFunctionTypes"

            Dim DS As DataSet
            Dim MyConnection As New SqlConnection
            Dim MyCommand As SqlDataAdapter

            grdAFT.DataSource = ""
            MyCommand = New SqlDataAdapter(strSQL, sqlcn)

            DS = New DataSet '("MyDynamicAFT")
            Try
                DS.Tables("MyAFT").Clear()
            Catch ex As Exception
                ' be sure we get a fresh query
            End Try

            MyCommand.Fill(DS, "MyAFT")

            grdAFT.DataSource = DS.Tables("MyAFT").DefaultView
            'Source.Sort = E.SortExpression

            Page.DataBind()
            MyConnection.Close()
        Catch ex As Exception
            Dim err As New MailError
            err.eMailError(ex, "AFT Binding")
        End Try
    End Sub
~Joe Johnston USA

"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform