Click here to Skip to main content
15,905,233 members

Comments by _Lovro_ (Top 3 by date)

_Lovro_ 5-Dec-13 6:22am View    
Are you able to send me code example how to do it since I am talking about dropdown in the grid?
_Lovro_ 5-Dec-13 6:21am View    
Problem is how to populate the dropdown in the grid

This is what I usually do when it is outside of the grid

Try
DropDownList3.Items.Clear()
Dim cmdgetpodaci As New SqlCommand("select * from filijale order by filijala", conn)
If conn.State = ConnectionState.Closed Then conn.Open()

Dim citaj As SqlDataReader = cmdgetpodaci.ExecuteReader

Me.DropDownList3.Items.Add(New ListItem("------------------------------------------", "0"))

Do While citaj.Read()
Dim newitem As New ListItem
newitem.Text = citaj.GetString(3)
newitem.Value = citaj.GetValue(3)
DropDownList3.Items.Add(newitem)
Loop

Catch ex As Exception
labelica.Visible = True
labelica.Text = "Problem prilikom spajanja na bazu" + ex.Message

Finally
conn.Close()
End Try

Can you send me the code example?
_Lovro_ 4-Dec-13 2:44am View    
Anyone knows the answer?