心澄欲遣

不践迹,亦不入于室

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
#region 初始化设备信息
/// <summary>
/// 初始化设备信息
/// </summary>
private void InitVMSDevice()
{

DataTable dt
= timsControl.GetVMSDeviceInfo();

DataRow dr
= dt.NewRow();
dr[
"glid"] = "-1";
dr[
"azdd"] = "请选择";
dt.Rows.InsertAt(dr,
0);

if (dt != null && dt.Rows.Count > 0)
{
this.cbxDevice.ValueMember = "glid";
this.cbxDevice.DisplayMember = "azdd";
this.cbxDevice.DataSource = dt;

this.cbxHistoryDevice.ValueMember = "glid";
this.cbxHistoryDevice.DisplayMember = "azdd";
this.cbxHistoryDevice.DataSource = dt;
}

string[] arr = new string[dt.Rows.Count];
for (int i = 0; i < arr.Length; i++)
{
arr[i]
= dt.Rows[i][1].ToString();
}

cbxDevice.AutoCompleteCustomSource.AddRange(arr);
cbxDevice.AutoCompleteSource
= AutoCompleteSource.CustomSource;
cbxDevice.AutoCompleteMode
= AutoCompleteMode.SuggestAppend;

cbxHistoryDevice.AutoCompleteCustomSource.AddRange(arr);
cbxHistoryDevice.AutoCompleteSource
= AutoCompleteSource.CustomSource;
cbxHistoryDevice.AutoCompleteMode
= AutoCompleteMode.SuggestAppend;
}

#endregion
PS:只能从首字符开始模糊查找
posted on 2011-04-28 15:10  心澄欲遣  阅读(1336)  评论(0编辑  收藏  举报
欢迎第myspace graphics个访客