0
添加內容列表視圖顯示的內容就像是問題與在ListView
ListViewItem item = new ListViewItem();
listView1.Items.Add(item);
item.Text = "fdfdfd";
item.SubItems.Add("melp");
item.SubItems.Add("asfd");
簡單proceess任何一個可以告訴我究竟是什麼回事,雖然這裏也被添加的內容和顯示,,這段代碼我從我的項目
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;
}
}
感謝您的寶貴信息,清除了我的dobts – peter 2009-10-29 12:53:11