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...
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...