Bill Crawley
June 12th, 2008, 07:27 AM
Hi All,
I have the following code that populates a dropdown
DropDownListInstructionType.Items.Add("")
For i = 0 To dtInstructionType.Count - 1
DropDownListInstructionType.Items.Add(dtInstructionType(i).InstructionType)
DropDownListInstructionType.Items(i + 1).Value = dtInstructionType(i).jtSysInstructionTypeID
Next
Later in my code I have a value that equtes to the 'Value' property and I want to set this so that the text is visible. I thought that something like
DropDownListInstructionType.Text = DropDownListInstructionType.Items.FindByValue(MyId)
Would set the text to the corresponding item, but it doesn't
I have the following code that populates a dropdown
DropDownListInstructionType.Items.Add("")
For i = 0 To dtInstructionType.Count - 1
DropDownListInstructionType.Items.Add(dtInstructionType(i).InstructionType)
DropDownListInstructionType.Items(i + 1).Value = dtInstructionType(i).jtSysInstructionTypeID
Next
Later in my code I have a value that equtes to the 'Value' property and I want to set this so that the text is visible. I thought that something like
DropDownListInstructionType.Text = DropDownListInstructionType.Items.FindByValue(MyId)
Would set the text to the corresponding item, but it doesn't