Skip to content

Infragistics Community Forum / Web / Ultimate UI for ASP.NET Web Forms / DropDown returns only System.Data.dataRowview

DropDown returns only System.Data.dataRowview

New Discussion
A
A asked on May 8, 2012 1:38 PM

Hi,

When I bind the DropDown on the codebehind, the Dropdown populates with

System.Data.DataRowView for as many records as there are.

Why is the actual data not being populated?

Mark up is as follows

 

 

 

 

<

 

 

ig:WebDropdown ID="ddlSearch" runat="server" Visible="False" AutoPostBack="True" DropDownContainerHeight="0px" EnableAutoFiltering="Server" EnableLoadOnDemand="True"><AutoPostBackFlags SelectionChanged="On" ValueChanged="On" /></ig:WebDropdown>

My code in behind is as follows

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Dim sqlConn As SqlConnection
Dim comm As SqlCommand
Dim da As SqlDataAdapter
Dim ds As New DataSet
sqlConn = New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
Try
comm = New SqlCommand("SELECT Col1 FROM XYZ", sqlConn)
comm.CommandType =
CommandType.Text
sqlConn.Open()
comm.ExecuteNonQuery()
da =
New SqlDataAdapter(comm)
da.Fill(ds)
da.Dispose()
For i As Integer = 0 To ds.Tables(0).Rows.Count – 1
ddlSearchShip.DataSource = ds
ddlSearchShip.DataBind()
ddlSearchShip.TextField =
"Col1"
Next
Catch ex As Exception
Response.Write(ex)
End Try
sqlConn.Close()
sqlConn.Dispose()

Sign In to post a reply

Replies

  • 0
    [Infragistics] Surya
    [Infragistics] Surya answered on May 3, 2012 9:41 PM

    Hello Svasala,

    Thank you for posting your question to Infragistics forums.

    From the code you have provided, I see that you are not binding the data to right WebDropDown. The ID of the WebDropDown in the markup is “ddlsearch” and in the codebehind is “ddlsearchship”. Change the “ddlsearchship” to ddlsearch and it should work.

    Please let me know if you have any questions.

    Thanks,

    Prabha

    • 0
      [Infragistics] Surya
      [Infragistics] Surya answered on May 8, 2012 1:38 PM

      Hello Svasala,

      Please let me know if I can provide any further assistance regarding this matter.

       

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
A
Favorites
0
Replies
2
Created On
May 08, 2012
Last Post
13 years, 10 months ago

Suggested Discussions

Created by

A

Created on

May 8, 2012 1:38 PM

Last activity on

May 8, 2012 1:38 PM