开发者

How Can I Choose Appropriate ComboBox Value Based on Select ListView Record? - C#.NET

开发者 https://www.devze.com 2023-01-01 07:44 出处:网络
http://img256.imageshack.us/img256/9417/snapshotapp.jpg http://img256.imageshack.us/img256/9417/snapshotapp.jpg

http://img256.imageshack.us/img256/9417/snapshotapp.jpg http://img256.imageshack.us/img256/9417/snapshotapp.jpg

Contact Title has a default value which is Sales Person. Anyhow, when a user click Edit on the chosen ListView record, i need Contact Title to have the right value that corresponds to the chosen record. For example, if user clicks edit, the fields on the left side will be filled with values. In this case, i want Contact Title to view the right 开发者_运维问答value.

How can i do it?

I hope my question is clear enough.


After you've retrieved the text from the list just use it to find the correct record in the ComboBox as:

cbo.SelectedIndex = cbo.FindStringExact("Sales Person")
0

精彩评论

暂无评论...
验证码 换一张
取 消