コード例 #1
0
ファイル: ListBox_Lookup.cs プロジェクト: dolani/CodeTorch
        private void FillList()
        {
            FirstLoad           = false;
            ctrl.DataTextField  = "Items.Description";
            ctrl.DataValueField = "Items.Value";
            ctrl.AutoPostBack   = AutoPostBack;
            ctrl.DataSource     = GetData();
            ctrl.DataBind();



            //to support criteria list edit - add mode
            //ctrl.DataSource = null;
        }
コード例 #2
0
        public void LlenaListBox(Int32 Id1, Int32 Id2, int?Id3, string conexion, string SP, ref Telerik.Web.UI.RadListBox RadListBox)
        {
            try
            {
                System.Collections.Generic.List <Comun> Lista = new System.Collections.Generic.List <Comun>();
                CapaDatos.CD__Comun claseCapaDatos            = new CapaDatos.CD__Comun();
                claseCapaDatos.LlenaCombo(Id1, Id2, Id3, SP, conexion, ref Lista);

                if (Lista.Count > 0)
                {
                    RadListBox.DataSource     = Lista;
                    RadListBox.DataValueField = "Id";
                    RadListBox.DataTextField  = "Descripcion";
                    RadListBox.DataBind();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }