本文整理汇总了C#中Gtk.TreeStore.ChangeSortColumn方法的典型用法代码示例。如果您正苦于以下问题:C# TreeStore.ChangeSortColumn方法的具体用法?C# TreeStore.ChangeSortColumn怎么用?C# TreeStore.ChangeSortColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.TreeStore
的用法示例。
在下文中一共展示了TreeStore.ChangeSortColumn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: heightColumnCompare
/*
//cannot be double
public int heightColumnCompare (TreeModel model, TreeIter iter1, TreeIter iter2) {
double val1 = 0;
double val2 = 0;
val1 = Convert.ToDouble(model.GetValue(iter1, firstColumn + 3));
val2 = Convert.ToDouble(model.GetValue(iter2, firstColumn + 3));
return (int) (10*val1-10*val2);
}
//cannot be double
public int weightColumnCompare (TreeModel model, TreeIter iter1, TreeIter iter2) {
double val1 = 0;
double val2 = 0;
val1 = Convert.ToDouble(model.GetValue(iter1, firstColumn + 4));
val2 = Convert.ToDouble(model.GetValue(iter2, firstColumn + 4));
return (int) (10*val1-10*val2);
}
*/
/*
public int birthColumnCompare (TreeModel model, TreeIter iter1, TreeIter iter2) {
DateTime val1;
DateTime val2;
val1 = UtilDate.DateAsDateTime(model.GetValue(iter1, firstColumn + 5).ToString());
val2 = UtilDate.DateAsDateTime(model.GetValue(iter2, firstColumn + 5).ToString());
return DateTime.Compare(val1, val2);
}
*/
private void fillTreeView(Gtk.TreeView tv, TreeStore store, string searchFilterName)
{
int except = currentSession.UniqueID;
int inSession = -1; //search persons for recuperating in all sessions
ArrayList myPersons = SqlitePerson.SelectAllPersonsRecuperable("name", except, inSession, searchFilterName);
foreach (Person person in myPersons) {
store.AppendValues (
person.UniqueID.ToString(),
person.Name,
getCorrectSex(person.Sex),
person.DateBorn.ToShortDateString(),
person.Description);
}
//show sorted by column Name
store.SetSortColumnId(1, Gtk.SortType.Ascending);
store.ChangeSortColumn();
}