It doesn't seem to be posible to add items manually (so much for \"drop in replacement\"), so I am trying to hook it into a class with the ILISTSOUCE interface. Not having much luck.
Basically, I need to add and remove items from the list view, either as top nodes or sub nodes. It only needs to go one level deep. So far I have just attempted to get anything into it.
In designer I created the bindinge source and added it under Rows>>DataSource. The following code produces \"UITest3.Form1+Word\" in every field:
ref class stopListSource: IListSource
{
public:
property bool ContainsListCollection
{
virtual bool get() = IListSource::ContainsListCollection::get
{
return true;
}
}
virtual IList^ GetList() = IListSource::GetList
{
bndStopList->Add(gcnew Word(\"Will\",4,9));
bndStopList->Add(gcnew Word(\"this\",4,9));
bndStopList->Add(gcnew Word(\"work?\",4,9));
return bndStopList;
}
};
ref class Word
{
public:
Word(){}
Word(String^ word, int level, int frequency)
{
word = _word;
level = _level;
frequency = _frequency;
}
property String^ _Word
{
String^ get()
{
return _word;
}
void set(String^ str)
{
_word = str;
}
}
property int Level
{
int get()
{
return _level;
}
void set(int lvl)
{
_level = lvl;
}
}
property int Frequency
{
int get()
{
return _frequency;
}
void set(int fr)
{
_frequency = fr;
}
}
private:
String^ _word;
int _level;
int _frequency;
};
static BindingList ^bndStopList = gcnew BindingList();
If anyone can show me how to do this properly, I would apprectiate it.
I am evaluating the trial version.