Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Typed Datasets and Delegate signatures

Reply
Thread Tools

Typed Datasets and Delegate signatures

 
 
MattM
Guest
Posts: n/a
 
      06-08-2007
I am working on a new Windows application with typed datasets and was looking
at creating a generic datagridview user control. I will have several typed
datasets for this application so I thought using one datagridview user
control to handle most of the basics would save time.

I was going to use delegates to handle some of the functions but when it
comes to loading the grid I can't get beyond the fact that each typed dataset
has it's own object return type which means the user control can't have a
generic one for loading the datagridview.

For example, I may have an Employee, Organization, and a Client object each
with it's own class file and custom serialization routine in my business
logic layer (BLL). Each BLL can be hooked up to the grid by setting the
datasource equal to the return of the serialization function that returns a
List(of Employee) or List (of Client). But if I want to make a delegate in my
user control I need to give it a generic signature so that all the typed
datasets can be used.

I tried something like this:

Public Delegate Function del_ReloadGrid() As List(Of Object)

But when I tried to hook up the return from one of my BLLs I get an error
saying that "Value of type system.collections.generic.list(of Client) cannot
be converted to system.collections.generic.list(of object).

Is there a better way to do this? Is it possible to create a generic
signature for the delegate so I can create a base datagridview user control?
 
Reply With Quote
 
 
 
 
MattM
Guest
Posts: n/a
 
      06-08-2007
Not sure if this will be the "best" approach but I think I answered my own
question by doing this:

Public Delegate Function del_ReloadGrid() As IList

"MattM" wrote:

> I am working on a new Windows application with typed datasets and was looking
> at creating a generic datagridview user control. I will have several typed
> datasets for this application so I thought using one datagridview user
> control to handle most of the basics would save time.
>
> I was going to use delegates to handle some of the functions but when it
> comes to loading the grid I can't get beyond the fact that each typed dataset
> has it's own object return type which means the user control can't have a
> generic one for loading the datagridview.
>
> For example, I may have an Employee, Organization, and a Client object each
> with it's own class file and custom serialization routine in my business
> logic layer (BLL). Each BLL can be hooked up to the grid by setting the
> datasource equal to the return of the serialization function that returns a
> List(of Employee) or List (of Client). But if I want to make a delegate in my
> user control I need to give it a generic signature so that all the typed
> datasets can be used.
>
> I tried something like this:
>
> Public Delegate Function del_ReloadGrid() As List(Of Object)
>
> But when I tried to hook up the return from one of my BLLs I get an error
> saying that "Value of type system.collections.generic.list(of Client) cannot
> be converted to system.collections.generic.list(of object).
>
> Is there a better way to do this? Is it possible to create a generic
> signature for the delegate so I can create a base datagridview user control?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SqlCacheDependency and Strongly Typed Datasets chris ASP .Net 2 02-25-2006 02:54 PM
Strongly typed datasets and nested repeaters Duncan Welch ASP .Net 3 04-07-2005 03:37 PM
Problem with Typed Datasets and Web Services Sparky ASP .Net 0 11-15-2004 09:02 AM
Strongly typed datasets and XML Big D ASP .Net 1 02-17-2004 11:32 PM
Traditional Collections and Objects or Typed Datasets ? Rob Thomas ASP .Net 3 08-26-2003 09:06 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57