I LOVE C#

Eyal Vardi

Experts4D

  • Eyal Vard

Firefox Extensions

Post News

February 2006 - Posts

Data Source Windows Tips & Trics

How to: Bind a Custom Control type to class public property in Data Source Windows

Step 1: Build your object

public class Machine
    {
        private string model;
        private string id;
        private decimal price;
        private Part part;

        public Machine()
        {
            part = new Part();
            parts = new List(); 
        }
        [Bindable(true)]
        public string Model
        {
            get { return model; }
            set { model = value; }
        }
        [Bindable(true)]
        public string Id
        {
            get { return id; }
            set { id = value; }
        }
        [Bindable(true)]
        public decimal Price
        {
            get { return price; }
            set { price = value; }
        } 
        [Bindable(true)]
        public Part Part
        {
            get { return part; }
        }
    }
    public class Part
    {
        private string partId;
        public string PartId
        {
            get { return partId; }
            set { partId = value; }
        }

        private string name;
        public string Name
        {
            get { return name; }
            set { name = value; }
        }
    }

Step 2: Build your UserControl ( for Part object )
    [DefaultBindingProperty("Part")]
    public partial class PartControl : UserControl
    {
        private Part m_Part;
        public Part Part
        {
            get { return m_Part; }
            set 
            { 
                m_Part = value;
                if ( !DesignMode && value != null )
                    partBindingSource.DataSource = value;
            }
        }

        public PartControl()
        {
            InitializeComponent();
            partBindingSource.DataSource = typeof(Part);
            txbName.DataBindings.Add  ("Text", partBindingSource, "Name");
            txbPartID.DataBindings.Add("Text", partBindingSource, "PartId");
        }
    }
Step 3: Customize the part property to the PartControl

* Open Data Source windows
* Select new data source
* Select Machine class
* Select Part property
* Right Click --> Customize --> Open Option Windows
* Select Other
* Select PartControl --> OK
* Select Part Property--> Right-Click--> Select PartControl
* Select Machine-->Right-Click--> Select Details
=================================
Drag and Drop the Machine to the form......
This demo for 1:1 for 1:M use ComplexBindingProperties or LookupBindingProperties attribute
Atlas January 2006 Release
http://www.asp.net/default.aspx?tabindex=9&tabid=47

For more info go to - http://www.nikhilk.net/AtlasM1Refresh.aspx
Posted: Feb 10 2006, 04:04 PM by Vardi | with no comments
Filed under:
Extender Property Providers in ASP.NET 2.0

 I tried to build web custom control that implement IExtenderProvider interface,

with no luck, Until I read the article http://www.codeproject.com/aspnet/PropertyExtendersASP20.asp

Enjoy

 

Hila News

טוב יום שישי היום ושוב אני כותבת לכם

עברו שבועים וכמו שחשבתי אף אחד ממכם לא הגיע

כדי להנות מהנחה בחנות ,חבל אתם הפסדתם נגמר המבצע

אני מקווה שבפעם הבאה תהייה תגובה ממכם אנשים

(ולך בן זה נחמד שאתה מגיע למצוא אותנו  מהולד נשיקות ממני)

זהו אנשים סוף שבוע טוב לכם תנסו להיות טובים ונדיבים לחיים

ויום אהבה שמח למי שיש לו אהבה

Posted: Feb 10 2006, 11:33 AM by Vardi | with 2 comment(s)
Filed under:
Turning an .ascx User Control into a Redistributable Custom Control

Please Read – http://msdn.microsoft.com/library/default.asp?url=/msdnmag/issues/05/10/WickedCode/toc.asp

It work fine for me !!!!

Posted: Feb 06 2006, 04:26 PM by Vardi | with 2 comment(s)
Filed under:
Aspxlab

Take look on – http://www.aspxlab.com/

AspxLab Controls 2.6 released. This version introduces two new controls: TabStrip and MultiPage. Also included: improved Visual Studio 2005 designer support and ASP.NET 2.0 data binding support.

Posted: Feb 05 2006, 03:01 PM by Vardi | with no comments
Filed under:
Sorting, Paging and Callbacks in GridView and DetailsView

I found nice property "EnableSortingAndPagingCallbacks ".

GridView and DetailsView support a special mode for paging and sorting that takes advantage of client-side callbacks to the server to obtain data for the new page or newly sorted data. To enable this feature, set the EnableSortingAndPagingCallbacks property to true.

Posted: Feb 04 2006, 04:44 PM by Vardi | with 2 comment(s) |
Filed under:
More Posts