all groups > dotnet windows forms designtime > march 2005 >
You're in the

dotnet windows forms designtime

group:

Custom CollectionEditor?



Custom CollectionEditor? Özden Irmak
3/18/2005 1:49:26 PM
dotnet windows forms designtime: Hi,

I want to show a custom collectioneditor in my property where no items could
be added or removed. I just want to be able to edit the current items in
that collection?

I digged a bit and tried to derive from "CollectionEditor" to make my custom
one but with not much success. Can anybody help me to achieve the effect I
want which I described above...?

Thanks in advance...

Regards,

Özden

Re: Custom CollectionEditor? mujdat
3/22/2005 12:22:23 AM
Sevgili Özden,
Collection editorden derive etmen pek bi iþe yaramaz çünkü o form editorun
içinde deðildir... O yüzden kendi editorunu yazmalýsýn.
O yüzden önce önce UITypeEditor kendi classýný derive et.. orda
GetEditStyle override et orda
System.Drawing.Design.UITypeEditorEditStyle.Modal döndür sonra EditValue
override edince Service providerdan GetServis le
System.Windows.Forms.Design.IWindowsFormsEditorService al sonra kendi
formunun instancesýný oluþtur.. sonra IWindowsFormsEditorService servisinde
ShowDialog la formunu göster çaðýr..Formun iþi bitince context in
OnComponenChanging sonra OncomponentChage çaðýr.. Eðer Asp uyguluyorsan
kendi edit formunuda original Collection u kopyala sonra o kopyayý Control
undeki ile set et yoksa component referansýnýn deðiþmediði sanarak senin
obejenin yeni halini serialize etmez..
Kolay gelsin..





[quoted text, click to view]

Re: Custom CollectionEditor? Özden Irmak
3/23/2005 12:58:12 PM
Selam,

Kendi editörümü yazmak istemediðim için acaba böle bi çözüm mevcutmu diye
soruþturmak istedim. Müþterim asil "CollectionEditor" u tercih ettiðini
söylemiþti çünkü.

Sonuç olarak kendi editörümü yazýp hallettim iþimi...

Yinede cevabýn için teþekkürler...

Sevgiler,

Özden

[quoted text, click to view]

AddThis Social Bookmark Button