From d39ad390c0f4efacc0676c5f9bdbb4f937381964 Mon Sep 17 00:00:00 2001 From: Ricardo Markiewicz Date: Thu, 7 Jul 2005 17:23:31 +0000 Subject: [PATCH 1/1] Implemento search y reordenacion en el treeview --- demo/src/Vistas/ConsultarAfiliado.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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) { -- 2.43.0