Click here to Skip to main content
16,006,440 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generallooping through first row of datagrid without moving onto next Pin
mcm20-Jan-03 9:55
mcm20-Jan-03 9:55 
GeneralRe: looping through first row of datagrid without moving onto next Pin
Richard Deeming21-Jan-03 1:45
mveRichard Deeming21-Jan-03 1:45 
Generalquery on scrrun.dll Pin
shanksprasad19-Jan-03 18:42
shanksprasad19-Jan-03 18:42 
GeneralImort an Event from a VC++ DLL Pin
Benno Huebscher19-Jan-03 3:04
sussBenno Huebscher19-Jan-03 3:04 
GeneralUsing SourceSafe Pin
Ilan Ehrenfeld19-Jan-03 1:42
Ilan Ehrenfeld19-Jan-03 1:42 
GeneralRe: Using SourceSafe Pin
Steven Lyons20-Jan-03 13:02
Steven Lyons20-Jan-03 13:02 
GeneralAdvanced Manipulation of WAVS Pin
EmilsHere18-Jan-03 11:14
EmilsHere18-Jan-03 11:14 
GeneralCalling my custom editor Pin
Julusian18-Jan-03 7:36
Julusian18-Jan-03 7:36 
Hello, I have the following problem: A class with a property called MyCollection which is, obviously, a collection. The collection MyCollection contains items of type MyItemCollection:

MyClass
property: MyCollection as CustomCollection

CustomCollection
property: MyItemCollection as SecondCustomCollection

Now, I designed custom editors for both "SecondCustomCollection" and "CustomCollection". They both work perfectly, but... When using the collection editor for MyCollection, I click "Add Item" and a new MyCollection item is created. The next step would be to call the editor for the MyItemCollection by pressing a button. That button should programatically call the editor for the second class... This is where I got stuck... Look:

cd is the MyItemCollection:

Dim tp As Type = cd.GetType ' I get it's type
Dim ac As AttributeCollection = t.GetAttributes(tp) ' I get it's attribs
Dim ed As EditorAttribute = CType(ac(GetType(EditorAttribute)), EditorAttribute) 'I get the editor

If Not ed Is Nothing Then ' found it?
Dim te As TypeEditors.ColumnDefCollectionEditor ' this is the editor type
te = New TypeEditors.ColumnDefCollectionEditor(GetType ColumnDefinition.ColumnDefinitionCollection))

Now, the logical call to edit the value would be:

cd = te.EditValue(context, provider, cd)

to launch the editor with the current object and return the same object with the changes.

The place I got stuck is finding the context and the provider. Here is what I tried:

Dim sv As System.ComponentModel.Design.ServiceContainer = New System.ComponentModel.Design.ServiceContainer()
sv.AddService(GetType(IWindowsFormsEditorService), Me)
te.EditValue(cd.GetType, sv, cd)

But it does not work... I get an error at AddService first of all...

So, my question is how can I get the IServiceProvider and the ITypeDescriptorContext required to programatically call my custom editor?

Any help would be appreciated!

Thank you,



Best Regards,
Iulian
Generalcalling a function to save to a table Pin
mcm18-Jan-03 5:11
mcm18-Jan-03 5:11 
GeneralRe: calling a function to save to a table Pin
Hesham Amin19-Jan-03 9:07
Hesham Amin19-Jan-03 9:07 
Generaltab event in datagrid Pin
mcm18-Jan-03 0:02
mcm18-Jan-03 0:02 
GeneralMiddle Button scroll in combo box Pin
shaquille o'neal17-Jan-03 9:18
sussshaquille o'neal17-Jan-03 9:18 
GeneralRe: Middle Button scroll in combo box Pin
mikasa17-Jan-03 9:58
mikasa17-Jan-03 9:58 
GeneralRe: Middle Button scroll in combo box Pin
shaquille O'Neal18-Jan-03 1:48
sussshaquille O'Neal18-Jan-03 1:48 
GeneralRe: Middle Button scroll in combo box Pin
Tim McCurdy18-Jan-03 7:24
Tim McCurdy18-Jan-03 7:24 
Generallooping through rows in datagrid to save to database Pin
mcm17-Jan-03 9:00
mcm17-Jan-03 9:00 
Generalwindows services Pin
StevensN17-Jan-03 6:22
StevensN17-Jan-03 6:22 
GeneralRe: windows services Pin
Ray Cassick17-Jan-03 7:08
Ray Cassick17-Jan-03 7:08 
Generalusing array (or recordset???!!) as datasource for datagrid Pin
mcm17-Jan-03 4:05
mcm17-Jan-03 4:05 
GeneralRunAs / LogOnAsUser Pin
cescosystem17-Jan-03 3:50
cescosystem17-Jan-03 3:50 
GeneralBidirectional TCP Genuine Channels are Available. Pin
Bill200217-Jan-03 0:14
Bill200217-Jan-03 0:14 
GeneralHOWTO Determine the Memory required for a DOMDocument Pin
Paul Farry16-Jan-03 20:08
professionalPaul Farry16-Jan-03 20:08 
Generalcopying arrays Pin
brieg100016-Jan-03 11:07
brieg100016-Jan-03 11:07 
GeneralRe: copying arrays Pin
Nick Seng16-Jan-03 14:34
Nick Seng16-Jan-03 14:34 
GeneralRe: copying arrays Pin
brieg100017-Jan-03 5:04
brieg100017-Jan-03 5:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.