加载页面时如何选择项目 [英] How to selecting an item when loading a page

查看:112
本文介绍了加载页面时如何选择项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个列表框,其中包含类似
的课程

1个Oracle
3 PLSQL
4个Oracle 11g DBA
10 Unix
11 Unix管理员

这些课程 {课程名称和课程ID} 来自数据库.

我的目的是为此选择 Oracle和PLSQL

我使用了以下代码
listViewBox1.Items [1] .Selected = true;
listViewBox1.Items [3] .Selected = true;

但这会将 1视为PLSQL ,而将 3视为Unix .

I have a listbox that contains Courses like


1 Oracle
3 PLSQL
4 Oracle 11g DBA
10 Unix
11 Unix Admin

These courses{Course Name and course ID} are coming from Database.

My intention is to select Oracle and PLSQL for that

I used the below code
listViewBox1.Items[1].Selected = true;
listViewBox1.Items[3].Selected = true;

But it is treating 1 as PLSQL and 3 as Unix.

推荐答案

你好,

您在解释项目数组时遇到问题吗?

考虑如下数组:

0-[1 Oracle]
1-[3 PLSQL]
2-[4 Oracle 11g DBA]
3-[10 Unix]
4-[11 Unix管理员]

;当您编写listViewBox1.Items [1] Selected = true时.您将获得:1-[3 PLSQL]

同样,当您编写listViewBox1.Items [3] Selected = true时.您可以获得[10 Unix]

可能要选择ID的值.为此有一种方法.

JAFC
Hello,

Are you having a problem interpreting the array of items.

Consider the array as follows:

0 - [1 Oracle]
1 - [3 PLSQL]
2 - [4 Oracle 11g DBA]
3 - [10 Unix]
4 - [11 Unix Admin]

When you write listViewBox1.Items [1] Selected = true.; you obtain: 1 - [3 PLSQL]

Likewise when you write listViewBox1.Items [3] Selected = true.; you obtain [10 Unix]

Probably want to choose the value for ID. There is a method for this purpose.

JAFC


这篇关于加载页面时如何选择项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆