Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8141019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:21:23+00:00 2026-06-06T12:21:23+00:00

I am creating a simple application in Silverlight 5 to test another application’s ability

  • 0

I am creating a simple application in Silverlight 5 to test another application’s ability to pull data from it. The goal is to have as many input types as possible to test the other application’s versatility. I am trying to add a DatePicker to a part of this form with the following code:

<sdk:DatePicker Grid.Row="3" Grid.Column="3" Height="25" Width="190" >
</sdk:DatePicker>

This works perfectly fine, but I want to make the TextBox component of the DatePicker read-only. The reason for this is that I want only valid dates to be entered into this text box, since I am then pulling the text from it and putting into a DataGrid. Any help would be appreciated! And if you need more information from me, just ask.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T12:21:25+00:00Added an answer on June 6, 2026 at 12:21 pm

    Create your own control that inherits from DatePicker:

    using System.Windows.Controls.Primitives;
    
    public class ReadonlyDatePicker : DatePicker
    {
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            var textBox = this.GetTemplateChild("TextBox") as DatePickerTextBox;
            textBox.IsReadOnly = true;
        }
    }
    

    Add the namespace to your project in your page:

    xmlns:MyControls="clr-namespace:MyControlsNamespace"
    

    Then reference your DatePicker using your namespace alias:

    <MyControls:ReadonlyDatePicker Grid.Row="3" Grid.Column="3" Height="25" Width="190" >
    </MyControls:ReadonlyDatePicker>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a simple silverlight application to display some text at realtime from
Im attempting to use Silverlight and MVC together. After creating a simple Silverlight application
We're currently creating a simple application for image manipulation in Silverlight, and we've hit
So I'm creating a simple application. I have a 'Games' database table and a
When I am creating a simple application for plist shown in below link: http://iosdevelopertips.com/data-file-management/reading-a-plist-into-an-nsarray.html
I have to build a web application in Silverlight. This application is entirely data
I have a doubt from a silverlight application we can access MyDocuments. I am
I am creating a simple application and getting stuck with data storage option. To
I'm creating a simple test application so I can see how ASP.Net MVC works
I am creating a simple application that keeps track of coins. I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.