Data bound list box automaticly selection

  • Thread starter Thread starter Brian Henry
  • Start date Start date
B

Brian Henry

Is there a way to keep a list box from automaticly selecting the first value
when its data bound? im doing something like this

Dim dsCategories As New DataSet

Dim daSQLCategories As New
SqlClient.SqlDataAdapter("SP_GetAccountsCategories",
database.dbConnectionData)

daSQLCategories.SelectCommand.CommandType = CommandType.StoredProcedure

daSQLCategories.SelectCommand.Parameters.Add("@accountID",
Data.SqlDbType.Int).Value = _accountID

dsCategories.Clear()

daSQLCategories.Fill(dsCategories, "SP_GetAccountsCategories")

Me.lstActCategories.DataSource =
dsCategories.Tables("SP_GetAccountsCategories")

Me.lstActCategories.DisplayMember =
dsCategories.Tables("SP_GetAccountsCategories").Columns("categoryName").ToSt
ring

Me.lstActCategories.ValueMember =
dsCategories.Tables("SP_GetAccountsCategories").Columns("categoryID").ToStri
ng



when its done executing the first item is always selected... which i dont
want it selected by default.. i tried setting selectedvalue to -1 and it
still was selected...
 
Hi Brian,

SelectedIndex I answered this in a latter question of you.

(This is for others to take the question not again)

Please stay the next time in the original thread?

Cor
 
Back
Top