DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Fri, 8 Jun 2007 06:17:01 -0700,    posted on: microsoft.public.dotnet.framework.aspnet.buildingcontrols        back       

Thread Index
  1    MattM
          2    MattM


Typed Datasets and Delegate signatures   
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?
Date:Fri, 8 Jun 2007 06:17:01 -0700   Author:  

RE: Typed Datasets and Delegate signatures   
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?
Date:Fri, 8 Jun 2007 06:45:00 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us