D
darrel
I have a DDL list along these lines:
item value="1" text="a"
item value="2" text="b"
item value="3" text="c"
item value="2" text="d"
item value="2" text="e"
item value="1" text="f"
item value="1" text="g"
The data I'm retrieving from the database maps to the TEXT field of the
items. So, if the data is 'g' I want to preselect the 7th item in the list
above.
I'm using this:
ddl_county.SelectedIndex =
ddl_county.Items.IndexOf(ddl_county.Items.FindByText(Trim(tablerow("jurisdiction"))))
But what it's doing is preselecting the first item that has the same value
as the item with the text I'm looking for. For instance, if the data is 'g',
it's selecting 'a'. If the data is 'e', it's selecting 'b'.
The above statement SEEMS to make sense, but I'm obviously not understanding
the logic fully. Can anyone point out the error of my logic?
-Darrel
item value="1" text="a"
item value="2" text="b"
item value="3" text="c"
item value="2" text="d"
item value="2" text="e"
item value="1" text="f"
item value="1" text="g"
The data I'm retrieving from the database maps to the TEXT field of the
items. So, if the data is 'g' I want to preselect the 7th item in the list
above.
I'm using this:
ddl_county.SelectedIndex =
ddl_county.Items.IndexOf(ddl_county.Items.FindByText(Trim(tablerow("jurisdiction"))))
But what it's doing is preselecting the first item that has the same value
as the item with the text I'm looking for. For instance, if the data is 'g',
it's selecting 'a'. If the data is 'e', it's selecting 'b'.
The above statement SEEMS to make sense, but I'm obviously not understanding
the logic fully. Can anyone point out the error of my logic?
-Darrel