From: Ricardo Markiewicz Date: Thu, 7 Jul 2005 17:23:31 +0000 (+0000) Subject: Implemento search y reordenacion en el treeview X-Git-Tag: svn_import~9 X-Git-Url: https://git.llucax.com/z.facultad/75.10/miklolife.git/commitdiff_plain/d39ad390c0f4efacc0676c5f9bdbb4f937381964?ds=sidebyside Implemento search y reordenacion en el treeview --- diff --git a/demo/src/Vistas/ConsultarAfiliado.cs b/demo/src/Vistas/ConsultarAfiliado.cs index 0b865b7..50ef4c4 100644 --- a/demo/src/Vistas/ConsultarAfiliado.cs +++ b/demo/src/Vistas/ConsultarAfiliado.cs @@ -45,7 +45,7 @@ public class VConsultarAfiliado xml = new Glade.XML (null, "consultar_afiliado.glade", "consultar_afiliado", null); xml.Autoconnect (this); - lista.Model = new ListStore (typeof(int), typeof(string), typeof(int), typeof (string), typeof(string)); + lista.Model = new TreeModelSort (new ListStore (typeof(int), typeof(string), typeof(int), typeof (string), typeof(string))); /* Columnas */ lista.HeadersVisible = true; @@ -54,6 +54,14 @@ public class VConsultarAfiliado lista.AppendColumn ("NĂºmero Doc.", new CellRendererText (), "text", 2); lista.AppendColumn ("Nombre", new CellRendererText (), "text", 3); lista.AppendColumn ("Apellido", new CellRendererText (), "text", 4); + + int i = 0; + foreach (TreeViewColumn col in lista.Columns) { + col.SortColumnId = i++; + } + lista.EnableSearch = true; + lista.Reorderable = true; + lista.HeadersClickable = true; } public void OnVerAfiliado (object o, EventArgs args) @@ -117,7 +125,7 @@ public class VConsultarAfiliado } AfiliadoSolicitanteController c = new AfiliadoSolicitanteController (); - ListStore store = (ListStore)lista.Model; + ListStore store = (lista.Model as TreeModelSort).Model as ListStore; store.Clear (); ArrayList lst = c.BuscarAfiliados (tipoDoc, nroDoc, cod, null); foreach (Afiliado p in lst) {