.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Changing DatePicker Date Label of 15

Posted By: Asim Sajjad     Posted Date: October 27, 2010    Points: 2   Category :WPF
To change the label of the date picker control in WPF is very easy. When you drag and drop the date picker control from the toolbox then it will show 15 as default, It will be nice to show current day is comfortable to show the current date.Image 1 shows the default date picker control when you drag and drop it from the toolbox here you can see that it display 15 which we want to change to show the current date.

View Complete Post

More Related Resource Links

Enter the date on the WPF DatePicker input textbox instead

When i type in the date on the date picker and check it on an lostfocus event and i try to read the text or selecteddate its blank?  Am i missing something.  I assumed typing in 5/11/2010 on the input box would either show up on the controls Text or the SelectedDate, but i may be missing something   Thanks

DataContractJsonSerializer changing my date

A user enters a date in a form, but when I pass the date through an AJAX json call, my date is getting changed by the DataContractJsonSerializer. Here's my AJAX call:function Save(){ //Convert date to milliseconds from from 1/1/1970 - necessary for passing a date through JSON var d = "09/01/2010 05:00"; myDate = new Date(d); myTicks = myDate.getTime(); var message = { MessageID: $("#MessageID").val(), MessageDate: '\/Date(' + myTicks + ')\/', }; $.ajax({ url: "<%= Url.Action("SaveMessage") %>", type: "POST", dataType: "json", data: $.toJSON(message), contentType: "application/json; charset=utf-8", success: function(result) { if (result && result.success) { // } } }); } Here's my serialization code:public override void OnActionExecuting(ActionExecutingContext filterContext){ if ((filterContext.HttpContext.Request.ContentType ?? string.Empty).Contains("application/json")) { var serializer = new DataContractJsonSerializer(RootType); filterContext.ActionParameters[Param] = serializer.ReadObject(filterContext.HttpContext.Request.InputStream); }} It's changing my dates to GMT. So if the user ente

Multivalue parameters - Changing label if (Select All) is selected

I'm using SSRS 2005.  I have a report which has a multi value parameter.  When you click (Select All) the text in the parameter combobox shows all the names of the possible values.  Since this is my default it really looks tacky and hard to read. Is there a way I can have the text in the multi value parameter combobox say "ALL" or something else when (Select All) is checked?  

MVC 2: How do you set a date by a datepicker in a grid?


I am new to MVC.

I have created a grid in my view using a foreach loop and a partial view;

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SHP.WebUI.Models.ChristmasShutdownExtended>" %>
            <td align="right"><%: Model.AvailableDate%><%: Html.HiddenFor(model => model.AvailableDate)%></td>
            <td><%: Model.Day%></td>

Changing Date format in Filter toolbar


i have added a toolbar to a Data View Web Part and enabled the Filter option. When i click on the filter, the Due Date field displays choices as Saturday, September 11, 2010. Within the DWVP I have the format set to mm/dd/yyyy, the differening formats seem to prevent the filter from working. How I can change the format in the filter dropdown ?

Thanks in advance

Dean MCTS-SQL 2005 Business Intelligence

changing Asp.net Gridview's cell from Label to edit mode in code behined file


 Hi all,

In my asp.net application i'm using gridview to which i'm binding data dynamically by writing a select query in code behined file (all column's are autogenerated) now i want to change gridview cell to edit mode from label to textbox or dropdown on clicking of gridview's cell.How can i achive this in code behined file.

thanks in advance

changing label context after chosing a value in cascadingdropdown



(i hope this is the right fourm)

how can i change the text of a label (by a value from the db) after i chose an item from a cascadingdropdown list?



Greater and Less Than Date with jQuery and DatePicker in MVC



I have this date value fetch from a Controller but when I use jQuery Datepicker with validation, the output is not good.
The validation is to check if the value is less than or greater than today's date. JQuery Datepicker works well.

If I select a date two days from now using datepicker, the validation error won't occur. Sad

ViewData("DateToday") = Date.Now.ToShortDateString()

<link href="/css/jQuery/jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js" type="text/javascript"></script>
<script src="/js/jquery.validate.min.js" type="text/javascript"></script>
     <script type="text/javascript">
         $().ready(function () {
             $.validator.addMethod("GreaterThanDate", function (value, element) {
                 return new Date.parse(value) > new Date();

Date not changing when selection changes in asp.net calendar

Date either changes ramdomly or does not change at all. I find the ajax calendar extender a little hard to work with. Thanks.
Partial Class Default2
    Inherits System.Web.UI.Page

    Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim datebox As New TextBox
        Dim calendar1 As New Calendar
        datebox = CType(DetailsView1.FindControl("datebox"), TextBox)
        datebox.Text = calendar1.SelectedDate.ToShortDateString()
    End Sub
End Class

        <asp:DetailsView ID="DetailsView1" runat="server" Height="207px" Width="342px" DataSourceID="AccessDatasource"
            AutoGenerateEditButton="True" AutoGenerateDeleteButton="True" 
            AutoGenerateRows="False" AutoGenerateInsertButton="True" 
                <asp:TemplateField HeaderText="PODate" SortExpression="POdate">
                     <asp:TextBox ID="datebox" runat="server" Text='<

Changing Default Language for British Date Format




After reading several topics about Datetime formats from US-English to British, I got more confused.  I have successfully changed Default Language on my local machine's SQL Server Express using this:

EXEC sp_configure 'default language', '23' 

But I can't change it on a Server side.  It prompts me to run 'RECONFIGURE' again and when I do I am getting this error:

"Address Windowing Extensions (AWE) is not supported in this edition of SQL Server."


Text from RequiredFieldValidator doesn't clear after picking date from jQuery UI DatePicker


I'm trying to use a RequiredFieldValidator with a TextBox that has a jQuery UI DatePicker attached to it. I'm finding that selecting a date from the datepicker does not trigger the RequiredFieldValidator to recognize that a value is now present. Thus, only server side validation is working for the RequiredFieldValidator and not client side. Any ideas on how I may fix this issue so both client side and server side validation fires?

Below is some sample code of this issue. To reproduce this situation: 1) Click the PostBack button (RequiredFieldValidator will indicate field is required) 2) Pick a date using the date picker 3) Notice that the RequiredFieldValidator's text still displays when it shouldn't.

<%@ Page
    Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">




        rel="stylesheet" />


Changing Date Format.




Currently I am using a shared sql server from My Hosting provider to send and receive some Data Fom my VB application. and as I am not an administrator i cant change the language. Even i can't access any sql properties.


but i want to change date format to dd-mm-yyyy instead of mm-dd-yyyy


Changing the graphics on the home page of a SharePoint site

When you create a site in Microsoft Windows SharePoint Services by using the default Team Site template, the home page includes two default graphics. A Windows SharePoint Services graphic appears in the body of the page, and a picture of a house in a circle appears near the site title. You can change these graphics to customize your site. Changing the smaller graphic requires a Windows SharePoint Services compatible Web page editor

Using a CompareValidator to check input is a valid date

The CompareValidator can do more than just compare two controls. You can also compare it against several of the main .net data types such as Date, Integer, Double and Currency.

To do this you would set Operator="DataTypeCheck" and instead of setting the ControlToCompare or ValueToCompare attributes as you normally would you use the Type="Date" (or any of the data types I have listed above).

How To Set a Date Format In GridView Using ASP.NET 2.0

A very common desire is to set a column of a gridview to display just the month, day and year of a DateTime type. The problem is the by default, the HtmlEncode property of the boundfield attribute (
The problem is that if this field is enabled, you can not pass format information to the boundfield control. That is, if you try the following code, you will not get the desired result.

jQuery Date picker Implementation in ASP.NET

I've posted a wrapper ASP.NET around the jQuery.UI Datepickercontrol. This small client side calendar control is compact, looks nice and is very easy to use and I've added it some time back to my control library.

This is primarily an update for the jQuery.ui version, and so I spend a few hours or so cleaning it up which wasn't as easy as it could have been since the API has changed quite drastically from Marc's original implementation. The biggest changes have to do with the theming integration and the resulting explosion of related resources.

If you want to use this component you can check it out a sample and the code here:

How to format datetime & date with century?

Execute the following Microsoft SQL Server T-SQL datetime, date and time formatting scripts in Management Studio Query Editor to demonstrate the usage of the multitude of temporal data formats available and the application of date / datetime functions.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend