Adding contents to listview is a simple proceess like
ListViewItem item = new ListViewItem();
listView1.Items.Add(item);
item.Text = "fdfdfd";
item.SubItems.Add("melp");
item.SubItems.Add("asfd");
Can any one tell me what exactly going on here though here also contents are added and displayed,,this bit of code i am taking from my project
protected override void OnUpdate()
{
string func = "ResourcePolicySystemsLVI.OnUpdate";
try
{
if(Data != null)
{
Text = base.Data.Name;
if(SubItems.Count == 1)
{
SubItems.Add(((IResourcePolicy)Data).ResourcePolicyEnabled.ToString()); // ResourcePolicyEnabled and ResourcePolicyCurrent are attributes
SubItems.Add(((IResourcePolicy)Data).ResourcePolicyCurrent.ToString());
}
else
{
SubItems[1].Text = ((IResourcePolicy)Data).ResourcePolicyEnabled.ToString();
SubItems[2].Text = ((IResourcePolicy)Data).ResourcePolicyCurrent.ToString();
}
}
base.OnUpdate();
}
/// <summary>
/// The IResourcePolicy interface of the ManagedDevice associated with this ListViewItem.
/// </summary>
public new IResourcePolicy Data
{
get
{
return (IResourcePolicy)base.Data;
}
}