본문 바로가기
Winform

Infragistics.Win.UltraWinEditors.UltraComboEditor

by 캡틴노랑이 2015. 11. 23.
반응형

체크 박스 설정

this.cbe.CheckedListSettings.CheckBoxStyle = Infragistics.Win.CheckStyle.CheckBox;

this.cbe.CheckedListSettings.EditorValueSource = Infragistics.Win.EditorWithComboValueSource.CheckedItems;


//프로그램적으로 아이템 체크 하기

ultraComboEditorSelectionDetail.Value = new object[]{"check1", "check2", "check3"};




드롭다운 리스트 타입 설정(수정가능, 불가능)

this.cbe.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;



////////////////////////////////////////////////////////////////////////////////////////////////////

//Basic bind sample

var dtSize = GetBindTable();

dtSize.Rows.Add(new object[] { ">", ">" });

dtSize.Rows.Add(new object[] { "<", "<" });

dtSize.Rows.Add(new object[] { ">=", ">=" });

dtSize.Rows.Add(new object[] { "<=", "<=" });

cbe.DisplayMember = "Text";

cbe.ValueMember = "value";

cbe.DataSource = GetItemList("All Size", "", "Text", "Value", dtSize);

cbe.SelectedText = "All Size";


protected DataTable GetBindTable()

{

    DataTable dt = new DataTable();

    dt.TableName = "search";


    dt.Columns.Add("Text", typeof(string));

    dt.Columns.Add("Value", typeof(string));


    return dt;

}


protected DataTable GetItemList(string selecteNm, string attachNm, string displayMember, string valueMember, DataTable dtSource)

{

    DataTable dt = GetBindTable();


    //if dtSource have data 

    if (dtSource.Rows.Count > 0)

    {

        foreach (DataRow dr in dtSource.Rows)

        {

            dt.Rows.Add(new object[] { dr[displayMember].ToString() + attachNm, dr[valueMember].ToString() });


            //DataRow addDr = dt.NewRow();

            //addDr["Text"] = dr[displayMember].ToString() + attachNm;

            //addDr["Value"] = dr[valueMember].ToString();


            //dt.Rows.Add(addDr);

        }

    }


    dt.Rows.Add(new object[] { selecteNm, "" });//selected text


    return dt;

}

////////////////////////////////////////////////////////////////////////////////////////////////////

반응형

댓글