Link to home
Start Free TrialLog in
Avatar of javagair
javagairFlag for United States of America

asked on

why am I getting System.Data.DataRowView as answer?

have this gridview which has dropdownlists
 <asp:gridview id="CustomersGridView"  
       autogeneratecolumns="false"
        autogenerateeditbutton="true"  
        onrowdatabound="CustomersGridView_RowDataBound"
        onrowediting="CustomersGridView_RowEditing"  
        onRowCancelingEdit="Customer_RowCancelingEdit"
        onRowUpdating="Customers_RowUpdating"
       
        runat="server">  
        <columns>
         
            <asp:boundfield datafield="WORKDATE"
            readonly="true"      
            headertext="DAY"/>
            <asp:boundfield datafield="STARTDAY"
            readonly="true"      
            headertext="DAY"/>
           
           <asp:TemplateField HeaderText="IN">
           <ItemTemplate>
             <asp:DropDownList ID="DropDownList1" runat="server"  >              
                 </asp:DropDownList>        
          </ItemTemplate>
             </asp:TemplateField>

in the onrowUpdatating function I have this to fill the dropdownlist1
If e.Row.RowType = DataControlRowType.DataRow Then
            Try
                sqlfindhrsfill = "Select JobCode from testday "
                Using adapter7 As SqlDataAdapter = New SqlDataAdapter(sqlfindhrsfill, Connection)
                    Connection.Open()
                    adapter7.Fill(Dst, "Dsthrslist")
                    Connection.Close()
                    Dim ddl = DirectCast(e.Row.FindControl("DropDownlist1"), DropDownList)
                    ddl.DataSource = Dst.Tables("DsthrsList")
                    ddl.DataBind()
                End Using
            Catch
            End Try
        End If
the sql table has a series of numbers: 0:00, 0:15 0:30 which amounts to a 24hr clock.  There are 97 entries
what I get on the dropdownlist is the line System.Data.DataRowView  97 times.

any suggestions

gary
SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of javagair

ASKER

tried it, sadly no.
I am thinking that to call rows one would have to fill each row with code.  I think I read someplace that the ddl knows how to fill from a table, could be wrong!  Probably a simple answer that is just alluding me.
usually use a coded list, first attempt at filling with table.

thanks

gary
If no one pops in with the correct answer sooner, I'll throw together a throw-away project at home and provide you with the correct approach.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
right answer, but kaufmed made we think about rows when I was missing the point.