hola, espero me puedan ayudar...

tengo una aplicacion que carga unos datos en un combobox, para luego seleccionar algunas opcion de las cargadas, pero no me permite elegir ninguna opcion, y cuando trato  de elegir alguna me aparece la advertencia en el terminal: gtk_entry_set_text: assertion `text != NULL' failed

este es el código que uso para cargar los datos al combobox:

public void Cargar_Datos (string datos, Gtk.ComboBoxEntry comboBox)
    {
       
        TreeIter iter;
        ListStore listStore = new Gtk.ListStore(typeof(string));
        comboBox.Model = listStore;
        CellRendererText text = new CellRendererText();
        comboBox.PackStart(text, false);
        comboBox.AddAttribute(text, "text", 0);   
       
               
        MySqlConnection conexion = new MySqlConnection(datos);
        conexion.Open();
        string query = "SELECT cod_concepto, descripcion FROM conceptos ORDER BY cod_concepto";
        MySqlCommand select = new MySqlCommand(query, conexion);
        MySqlDataReader lector;
        lector = select.ExecuteReader();
                   
            while (lector.Read())
            {
                string valor= lector.GetString(0)+" | "+ lector.GetString(1);
                listStore.AppendValues(valor);
            }
       
          if (listStore.GetIterFirst (out iter))
         {
             comboBox.SetActiveIter (iter);
         }
       
        lector.Close();
        conexion.Close();
    }
_______________________________________________
gluc mailing list
[email protected]
http://afrodita.unicauca.edu.co/mailman/listinfo/gluc

Responder a