2024年3月26日发(作者:)

comboxIlist 如果绑定的是List那需要绑定实体类里的属性

名 yMember User_Name

ember User_Ide 注意手动赋值

edIndex -1的时候也会触发

comboBox1_SelectedIndexChanged事件 需要得到被选中的

文本时用的是不是edText

//SelectedText是指被鼠标框中的文本不是选中项的文本

//SelectedItem是指选中项所指向的对象 如果 //IList a

r //urce a //那么

SelectedItem就代表IList里的其中一项 //如果toString的话

就会出现 “”(这是一个名称的字符串) 所

以如果要获取combox中的value和值当当使用

SelectedValueChanged方法时应该采用如下方法:

product__id 强转的类

型改成你对应的实体类 如果在点击某个按钮事件的时候触

发, 需要采用如下方法

ng private void

frmSelectProduct_Loadobject sender EventArgs e

urce

CateDatasetForCombox

yMember cate_name

ember cate_id

//edIndex -1 //初始化产品列表 string

sql select t__id t_name sql _price

t__name sql from product_list aproduct_cate

b where __id

ent

Center

urce

ProductBySqlsql private void

combParentCate_SelectedValueChangedobject sender

EventArgs e //mTextcate_ng

//int tmpCateId

ng

string sql select t__id t_name sql

_price t__name sql from product_list

aproduct_cate b where __id if tmpCateId 0 sql and

_id tmpCateId

ent

Center

urce

ProductBySqlsql private void

btnSearch_Clickobject sender EventArgs e int tmpCateId

ng string

sql select t__id t_name sql _price

t__name sql from product_list aproduct_cate

b where __id if tmpCateId0 sql and _id

tmpCateId

ent

Center

urce

ProductBySqlsql datasetcombox 如:

DataSet userDs UserDataset

urce sys_adminuser

yMember user_name ember

user_id /// 用户名更换的时候提示权限 private void

combUser_SelectedValueChangedobject sender EventArgs e

DataRowView tmpdrv edItem

int tmpUserId r_ng

permissions_group tmpGroupId

32tmpUserId.G

roup_id _name