Re: CodeDomSerializer Property issue

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Matt Miller (mmiller_at_gcsaustin.com)
Date: 09/15/04

  • Next message: Jim Craddock via .NET 247: "Dynamicly Added Range Validator Acting Goofy"
    Date: Wed, 15 Sep 2004 19:24:44 GMT
    
    

    Sorry about the duplicated posts, I thought .net 247 had lost my
    messages

    On Wed, 15 Sep 2004 11:51:23 -0700, Matthew Miller via .NET 247
    <anonymous@dotnet247.com> wrote:

    >I've created 2 custom web controls, a custom datalist and a paging control. The end user will drag a new instance of the datalist and paging control to the web form and then associate the datalist control with the paging control by setting a property. When this property is set I need the following code created
    >
    >InitializeComponent()
    >{
    >//
    >//pagingControl1
    >//
    >pagingControl1.DataList = dataList1;
    >pagingControl1.PageChanged += new PageChangedHandler(pagingControl1_PageChanged);
    >}
    >
    >private void pagingControl1_PageChanged(object sender, PageChangedEventArgs e)
    >{
    > dataList1.PageIndex = e.PageIndex;
    > dataList1.DataBind();
    >}
    >
    >My solution to this was to create a custom Serializer/Deserializer and insert the code from there.
    >
    >The problem is that the serializer runs before the property is applied to the pageControl1. Running the BaseSerializer for this is no help since the serializer doesn't know how to apply the dataList1 value to the system. Do I need to use some sort of TypeConverter with an InstanceDescriptor? I tried setting that up but I don't understand how to specify the instance being passed in. All I really need to create the code shown is the string "dataList1" but I have no idea how to find that value.
    >
    >Thanks,
    >
    >Matt
    >
    >--------------------------------
    >From: Matthew Miller
    >
    >-----------------------
    >Posted by a user from .NET 247 (http://www.dotnet247.com/)
    >
    ><Id>dbaVDxYxBUuVa8cVtuZ8rw==</Id>


  • Next message: Jim Craddock via .NET 247: "Dynamicly Added Range Validator Acting Goofy"

    Relevant Pages

    • Dataset anomalies
      ... Updating database with changes to dataset on Form Closing ... How do I get around this to accomodate update of a row even when focus is not lost from curretn row? ... private void Division_ColumnChanging(object sender, System.Data.DataColumnChangeEventArgs e) ...
      (microsoft.public.dotnet.framework.windowsforms)
    • CodeDomSerializer Property issue
      ... InitializeComponent() ... private void pagingControl1_PageChanged(object sender, PageChangedEventArgs e) ...
      (microsoft.public.dotnet.framework.aspnet.webcontrols)
    • Problem: Value of a variable is lost on second postback
      ... I found that the value of a variableis lost ... after the aspx page postback. ... private void Page_Load(object sender, System.EventArgs e) ... private void Command1_Click ...
      (microsoft.public.dotnet.framework.aspnet)
    • lossing data when changing page
      ... first page in datagrid is fine all the data is there but on the second ... private void Page_Load(object sender, System.EventArgs e) ...
      (microsoft.public.dotnet.framework.aspnet.datagridcontrol)
    • lossing data when changing page
      ... first page in datagrid is fine all the data is there but on the second ... private void Page_Load(object sender, System.EventArgs e) ...
      (microsoft.public.dotnet.framework.aspnet.datagridcontrol)