コード例 #1
0
        public override DataTable GetSelectedValue()
        {
            ArrayList valueList = new ArrayList();

            string value = cboValue.SelectedValue;
            int    start = 0;
            int    found = 0;

            do
            {
                found = value.IndexOf(",", start);
                if (found > 0)
                {
                    valueList.Add(value.Substring(start, found - start));
                }
                else
                {
                    valueList.Add(value.Substring(start));
                }
                start = found + 1;
            }while (found > 0);

            if (valueList.Count == 0)
            {
                return(null);
            }

            DataTable dt = null;

            if (ComboValueTable != null)
            {
                dt = ComboValueTable.Clone();
                for (int i = 0; i < ComboValueTable.Rows.Count; i++)
                {
                    string rawid = ComboValueTable.Rows[i][Definition.DynamicCondition_Search_key.VALUEDATA].ToString();
                    if (valueList.Contains(rawid))
                    {
                        dt.ImportRow(ComboValueTable.Rows[i]);
                    }
                }
            }

            //return valueList;
            return(dt);
        }
コード例 #2
0
ファイル: ComboControl.cs プロジェクト: aliceshin/origine
        public override DataTable GetSelectedValue()
        {
            ArrayList alSelValue = new ArrayList();

            alSelValue.Add(cboValue.SelectedItem);

            DataTable dt = ComboValueTable.Clone();

            for (int i = 0; i < ComboValueTable.Rows.Count; i++)
            {
                string rawid  = ComboValueTable.Rows[i][Definition.DynamicCondition_Search_key.VALUEDATA].ToString();
                string select = ((DataRowView)cboValue.SelectedItem).Row[Definition.DynamicCondition_Search_key.VALUEDATA].ToString();
                if (select == rawid)
                {
                    dt.ImportRow(ComboValueTable.Rows[i]);
                }
            }

            return(dt);
            //return alSelValue;
        }