Multi-Line ListView for .NET CF (Description, Source Code, and Example)
Here I will provide a description of the main properties and methods of the GraphListView component.
The most important thing is to specify the data source:
//1. Бросаем на форму GraphListView
//связываем компонент с данными и обновляем его.
graphListView1.GraphListDataSet = new DataSet();
string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\\\dataset.xml";
//В данном случае источник данных загрузили из XML файла.
graphListView1.GraphListDataSet.ReadXml(path);
//Указываем наименование таблицы в источнике данных
graphListView1.DataTableName = "Table";
//Указываем наименование поля таблицы в котором передается значение
graphListView1.FieldValue = "ID_DOCHEAD";
//Указываем наименование поля таблицы в котором передается отображаемое наименование
graphListView1.FieldDisplay = "NAME";
//Количество строк в позиции, можно не указывать по умолчанию 2;
//Может принимать значение от 1 до 10;
graphListView1.RowCountByPos = 2;
//Цвет текста, можно не указывать по умолчанию Белый;
graphListView1.FontColor = Color.Red;
//Обязательная функция после применения всех обязательных параметров выше.
//Заполнит и отобразит Список.
graphListView1.RefreshList();
RefreshList — must be run after each change in the data source.
Useful functions of the component:
//Перерисовывает компонент
graphListView1.RepaintList();
//Перейти на позицию вверх
graphListView1.MoveUp();
//Перейти на позицию вниз
graphListView1.MoveDown();
The Selectionchanged event occurs when the selected position is changed.
Returned parameters:
SelectedIndex — The index of the selected value (ordinal number in the list).
SelectedValue — The selected value.
SelectedName — The name of the selected position.
Example with source code can be downloaded here:
testcomponent_glw.rar · 18 downloads
The source code of the component can be downloaded here:
graphlistview_source.rar · 18 downloads
P.S. Suggestions for component development, found bugs and inaccuracies are welcome.
- testcomponent_glw.rar 6.9 MB 18 downloads
- graphlistview_source.rar 97.2 KB 18 downloads
Comments (0)
No comments yet.