Wednesday 9 November 2011

How to add the extender to Silverlight TextBox

Question Received:
         To add the extender to validate any value typed in the TextBox.

Solution:
        i. Create DataSource.cs which contains the getter/setter methods for evaluating the value in the TextBox.
        ii.Integrate it with the Page.xaml.cs using instance to point the DataContext in the LayoutRoot.
        iii.Bind the Data to the necessary controls (ie.,TextBox).
        iv.Throw the error on exception and make it to be caught from 'LayoutRoot'.
        v. Add the necessary handler in the 'page.xaml.cs'.
        vi.However, all the handlers will be coded in the 'page.xaml.cs'.
        vii.Alright, Compile and execute it will be working.
        viii.Download the detailed document from, ExtenderToSilverLightControls.docx.
        ix.Download the source from, SilverlightDataValidation.

[Note:]
    --> Make sure that the DataSource to initialize the value, that will not throw the error on Page_init() or page_Load().
    --> If so, silverlight application will not be starting.

No comments:

Post a Comment