Click here to Skip to main content
16,004,977 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Image Source Pin
mido1316-Jun-06 15:14
mido1316-Jun-06 15:14 
Questiongetting group information Pin
Bis198214-Jun-06 0:28
Bis198214-Jun-06 0:28 
AnswerRe: getting group information Pin
sasidar_d14-Jun-06 3:46
sasidar_d14-Jun-06 3:46 
GeneralRe: getting group information Pin
Bis198214-Jun-06 4:43
Bis198214-Jun-06 4:43 
GeneralRe: getting group information Pin
sasidar_d14-Jun-06 21:29
sasidar_d14-Jun-06 21:29 
GeneralRe: getting group information Pin
Bis198214-Jun-06 5:01
Bis198214-Jun-06 5:01 
GeneralRe: getting group information Pin
sasidar_d14-Jun-06 22:14
sasidar_d14-Jun-06 22:14 
GeneralProgrammatically Select item in ComboBox where ValueMember is known Pin
mincefish14-Jun-06 0:26
mincefish14-Jun-06 0:26 
Hello,

I've got a form that I create to show certain information about a specfied ClientID. I also load a combo box of all the Clients, so that the user can also pick up (and use) information that is currently associated with other clients.

When I load the combo box of all Clients, I also want to set the Combo box to show the specified client, for continuity. I can't seem to work out how to do this!

A brief overview of how I load the combo box is as follows:

 <code>       Dim strProc As String = "usp_ClientSubDetails_LoadControls"
        Dim dsClients As New DataSet
        Dim drClients As DataRow
        Dim iRowCtr As Integer = 0
        Dim iSelectionVal As Integer = 0
        Dim iLoop As Integer ' to find the client in the combo box

	'return dataset with client list in it
        If Not fncConnectSelectDataset(strProc, CommandType.StoredProcedure, dsClients, sysSystemData.SchedulerDb) Then
            strError = strProc
            Return False
        End If

	'make sure there's records in the table
        If dsClients.Tables(0).Rows.Count = 0 Then
            strError = "No Rows Returned"
            Return False
        End If

        For Each drClients In dsClients.Tables(0).Rows
	'DataLoader is a class that has an ID property and a DisplayValue property
            Me.cboClients.Items.Add(New DataLoader(drClients.Item(0), drClients.Item(1)))
        Next

        Me.cboClients.DisplayMember = "DisplayValue"
        Me.cboClients.ValueMember = "ID"
</code>
<font color="Black" face="Verdana">This gives me a combo box loaded with a bunch of DataLoader objects. By doing </font>CType(cboClients.SelectedItem,DataLoader).ID
<font color="Black" face="Verdana"> I can retrieve the ClientID... I just don't know how to set it, so that if I've told the Form to load details for ClientID 15, it also selects ClientID 15 from the combo box.<br />
<br />
Your help is gratefully appreciated.<br />
<br />
Regards,<br />
<br />
Tom<br />
</font>







GeneralRe: Programmatically Select item in ComboBox where ValueMember is known [modified] Pin
Dinuj Nath14-Jun-06 1:21
Dinuj Nath14-Jun-06 1:21 
GeneralRe: Programmatically Select item in ComboBox where ValueMember is known Pin
mincefish14-Jun-06 1:47
mincefish14-Jun-06 1:47 
GeneralRe: Programmatically Select item in ComboBox where ValueMember is known Pin
Dinuj Nath14-Jun-06 2:45
Dinuj Nath14-Jun-06 2:45 
GeneralRe: Programmatically Select item in ComboBox where ValueMember is known Pin
mincefish14-Jun-06 2:58
mincefish14-Jun-06 2:58 
GeneralRe: Programmatically Select item in ComboBox where ValueMember is known Pin
Dinuj Nath14-Jun-06 19:25
Dinuj Nath14-Jun-06 19:25 
GeneralRe: Programmatically Select item in ComboBox where ValueMember is known Pin
mincefish15-Jun-06 0:30
mincefish15-Jun-06 0:30 
GeneralRe: Programmatically Select item in ComboBox where ValueMember is known Pin
Dinuj Nath15-Jun-06 1:08
Dinuj Nath15-Jun-06 1:08 
Questionimage enhancement Pin
ndox14-Jun-06 0:18
ndox14-Jun-06 0:18 
AnswerRe: image enhancement Pin
Christian Graus14-Jun-06 0:52
protectorChristian Graus14-Jun-06 0:52 
GeneralRe: image enhancement Pin
ndox14-Jun-06 13:58
ndox14-Jun-06 13:58 
QuestionUrgent : how to get properties info of MSI file thru VB code ?? Pin
Supriya Tonape13-Jun-06 21:50
Supriya Tonape13-Jun-06 21:50 
Questionchart in VB.net Pin
MffM13-Jun-06 20:23
MffM13-Jun-06 20:23 
AnswerRe: chart in VB.net Pin
Dave Kreskowiak14-Jun-06 6:32
mveDave Kreskowiak14-Jun-06 6:32 
Questionset up prob Pin
bony_baba13-Jun-06 18:47
bony_baba13-Jun-06 18:47 
AnswerRe: set up prob Pin
Dave Kreskowiak14-Jun-06 6:27
mveDave Kreskowiak14-Jun-06 6:27 
QuestionRe: set up prob Pin
bony_baba14-Jun-06 20:36
bony_baba14-Jun-06 20:36 
AnswerRe: set up prob [modified] Pin
Dave Kreskowiak15-Jun-06 1:29
mveDave Kreskowiak15-Jun-06 1:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.