• Upgrade your Internet Experience
  • Sign in
  • Microsoft.com
  • United States (English)
    Brasil (Português)Česká republika (Čeština)Deutschland (Deutsch)España (Español)France (Français)Italia (Italiano)Россия (Русский)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語)香港特别行政區 (中文)
 
 
Microsoft Developer Network
 
 
Home
 
 
Library
 
 
Learn
 
 
Downloads
 
 
Support
 
 
Community
 
 
Forums
 
 
 
Microsoft Developer Network > SharePoint Products and Technologies Forums > SharePoint - Workflow > Sharepoint Custom Activity for workflows : dependency property which is of type "Typed DataTable".
Ask a questionAsk a question
Search Forums:
  • Search SharePoint - Workflow Forum Search SharePoint - Workflow Forum
  • Search All SharePoint Products and Technologies Forums Search All SharePoint Products and Technologies Forums
  • Search All MSDN Forums Search All MSDN Forums
 

AnswerSharepoint Custom Activity for workflows : dependency property which is of type "Typed DataTable".

  • Monday, January 05, 2009 10:57 AMMonicaT Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    Hi,

    I m creating a sharepoint custom activity for workflows.
    Can someone please tell me if it is feasible to create a dependency property which is of type "Typed DataTable"?


    I have created a property as:

    public static DependencyProperty DtProperty = DependencyProperty.Register("DtProperty", typeof(TypedDataTable.DataTable), typeof(Activity.OperationActivity));

    [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]

    [BrowsableAttribute(true)]

    [CategoryAttribute("Misc")]

    public TypedDataTable.DataTable dt1
    {

    get

    {

    return ((TypedDataTable.DataTable)(base.GetValue(Activity.OperationActivity.DtProperty )));

    }

    set

    {

    base.SetValue(Activity.OperationActivity.DtProperty  value);

    }

    }


    It gives me below error message:
    Could not create activity of type 'Activity.OperationActivity'. System.ArgumentException: Type 'Activity.OperationActivity' does not define a static dependency property with name 'DtPropertyProperty'.
    Parameter name: ownerType
       at System.Workflow.ComponentModel.DependencyProperty.ValidateAndRegister(String name, Type propertyType, Type ownerType, PropertyMetadata defaultMetadata, Type validatorType, Boolean isRegistered)
       at System.Workflow.ComponentModel.DependencyProperty.Register(String name, Type propertyType, Type ownerType)
       at Activity.OperationActivity..cctor()


    Any help on this??

    • Moved byMichael Washam - MSFTMSFT, ModeratorMonday, January 05, 2009 1:42 PMmore appropriate (Moved from SharePoint - Development and Programming to SharePoint - Workflow)
    • Edited byMike Walsh MVPMVP, ModeratorMonday, January 05, 2009 3:10 PM"for workflows" added to Subject
    •  
    • ReplyReply
    • QuoteQuote
     

Answers

  • Wednesday, January 07, 2009 1:39 AMWindie Chai [MVP]MVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     AnswerHas Code
    Vote As Helpful
    0
     Hi,

    The correct code should be:

    public static DependencyProperty DtProperty = DependencyProperty.Register("dt1", typeof(TypedDataTable.DataTable), typeof(Activity.OperationActivity));
    ......
    public
     TypedDataTable.DataTable
    dt1
    {
    ......
    }

    the 1st parameter of Register method must be a correct valid property name, and the 2nd parameter is the type of that property.

    And I must remind you, if you want to use this property in SharePoint workflow, please ensure TypedDataTable.DataTable can be serialize.


    My blog: http://xiaoshatian.cnblogs.com
    • Marked As Answer byLambert QinMSFT, ModeratorTuesday, January 13, 2009 8:56 AM
    •  
    • ReplyReply
    • QuoteQuote
     

All Replies

  • Monday, January 05, 2009 1:42 PMMichael Washam - MSFTMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    Moving to the workflow forums
    Posting is provided "AS IS" with no warranties, and confers no rights.
    • ReplyReply
    • QuoteQuote
     
Need Help with Forums? (FAQ)
 
© 2009 Microsoft Corporation. All rights reserved.
Terms of Use
|
Trademarks
|
Privacy Statement