我有一個dataTreeListView
作爲添加到它如下這已經得到了當場打死列標題:ObjectListView重新排序列
oCol2.IsVisible = false;
dataTreeListView.AllColumns.AddRange(new OLVColumn[] { oCol1, oCol2, oCol3, oCol4, oCol5});
dataTreeListView.KeyAspectName = id;
dataTreeListView.ParentKeyAspectName = ParentId;
dataTreeListView.DataSource = list;
dataTreeListView.RootKeyValue = 0;
名單本身已經得到了7種性質(包括Id
和ParentId
)。
我試圖實現的是,在selectedIndex
更改組合框時,列標題將改變位置。
From View (type1) (oCol2.IsVisible = false):
oCol1 (expandable) | oCol2 (hidden) | oCol3 | oCol4 | oCol5
To View (type2) (oCol2.IsVisible = true):
oCol2 | oCol1 (expandable) | oCol3 | oCol4 | oCol5
我現在得到的是視圖(TYPE1)工作正常,但切換到查看TYPE2後,可擴展柱仍處於oCol1而不是oCol2。看來,我不能switch
的主要欄目。
對此有何幫助?
的2型視圖,然後再oCol1(可擴展)定義oCol2。根據你的問題,這看起來像一個預期的輸出。除非我錯過任何東西。 –
嗨theghostofc,我試圖做這樣的事情。 dataTreeListView.AllColumns.Clear(); oCol2.IsVisible = true; dataTreeListView.AllColumns.AddRange(new OLVColumn [] {oCol2,oCol1,oCol3,oCol4,oCol5,}); 結果仍然是一樣的,第一列的oCol1 – user3167398