protected void DateTimeColumnDataHandler(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) { DateTime date = (DateTime)model.GetValue(iter, column.SortColumnId); CellRendererDateTime renderer = (CellRendererDateTime)cell; renderer.Text = date.ToString(renderer.Format); }
public void AddColumnDateTime(string title, string format, int sortid, int col) { store.SetSortFunc(col, new TreeIterCompareFunc(DateTimeTreeIterCompareFunc)); column = new TreeViewColumn(); datetimerenderer = new CellRendererDateTime(); datetimerenderer.Format = format == null ? "G" : format; column.Title = title; column.SortColumnId = sortid; column.Sizing = TreeViewColumnSizing.Autosize; column.Reorderable = true; column.Resizable = true; column.Expand = false; column.Alignment = 0.0f; column.PackStart(datetimerenderer, true); column.SetCellDataFunc(datetimerenderer, new TreeCellDataFunc(DateTimeColumnDataHandler)); tree.AppendColumn(column); }
public void AddColumnDateTime(string title, string format, int sortid, int col) { store.SetSortFunc(col, new TreeIterCompareFunc(DateTimeTreeIterCompareFunc)); column = new TreeViewColumn (); datetimerenderer = new CellRendererDateTime (); datetimerenderer.Format = format == null ? "G" : format; column.Title = title; column.SortColumnId = sortid; column.Sizing = TreeViewColumnSizing.Autosize; column.Reorderable = true; column.Resizable = true; column.Expand = false; column.Alignment = 0.0f; column.PackStart (datetimerenderer, true); column.SetCellDataFunc (datetimerenderer, new TreeCellDataFunc(DateTimeColumnDataHandler)); tree.AppendColumn(column); }