Example #1
0
        protected void llenarComboRol()
        {
            ListStore datos = new ListStore(typeof(string), typeof(string));

            datos = dtr.listarRol();
            TreeIter iter;

            this.cbxRol.InsertText(0, "Seleccione");

            if (datos.GetIterFirst(out iter))
            {
                do
                {
                    this.cbxRol.InsertText(Convert.ToInt32(datos.GetValue(iter, 0)), (String)datos.GetValue(iter, 1));
                } while (datos.IterNext(ref iter));
            }
        }
Example #2
0
        public frmRol() : base(Gtk.WindowType.Toplevel)
        {
            this.Build();

            //Precarga de los datos en el TreeView
            this.tvRol.Model = dtr.listarRol();
            string[] titulos = { "ID", "DESCRIPCION" };

            for (int i = 0; i < titulos.Length; i++)
            {
                this.tvRol.AppendColumn(titulos[i], new CellRendererText(), "text", i);
            }
        }