Skip to content

Replies

0
Ivaylo Ganchev
Ivaylo Ganchev answered on Jul 25, 2016 1:17 PM

Hello,

 

Thank you for posting in our community.

From what I understand, the issue is a lack of AM, PM when using fr-CA culture. WebDateTime editor is based on the official culture and date/time formats implemented by Microsoft.

I have investigated the matter for you, and it appears it is the expected culture specific behavior, based on the following
MSDN resource
, and in particular:

 

DateTime date1 = new DateTime(2008, 4, 10, 6, 30, 0);
Console.WriteLine(date1.ToString(“f“, CultureInfo.CreateSpecificCulture(“en-US“)));
// Displays Thursday, April 10, 2008 6:30 AM                       

Console.WriteLine(date1.ToString(“f“, CultureInfo.CreateSpecificCulture(“fr-FR“)));

// Displays jeudi 10 avril 2008 06:30 

 

fFull date/time pattern (short time).

 

Full date/time pattern (short time).

 

More information: The Full Date Short Time (“f”) Format Specifier.

 

 

2009-06-15T13:45:30 -> Monday, June 15, 2009 1:45 PM (en-US)

 

2009-06-15T13:45:30 -> den 15 juni 2009 13:45 (sv-SE)

 

2009-06-15T13:45:30 -> Δευτέρα, 15 Ιουνίου 2009 1:45 μμ (el-GR)

 

 

Based on these, I suggest each Specific Culture determines if the AM, PM portion should be show or not in the predefined date/time patters. 

In case you would like to set this portion to be always visible and use custom patter, you can use tt at the end of the pattern.


PMDesignator Property

 If the custom pattern includes the format pattern “tt” and the time is after noon, 
DateTime.ToString
 displays the value of PMDesignator in place of the “tt” in the format pattern. If the custom pattern includes the format pattern “t”, only the first character of PMDesignator is displayed. Your application should use “tt” for languages for which it is necessary to maintain the distinction between AM and PM.

For example, the following output / 28-09-2010 11:56  AM / is based on :

WebDateTimeEditor4.Culture = new System.Globalization.CultureInfo(“fr-CA”); 

 

    <ig:WebDateTimeEditor ID="WebDateTimeEditor4" runat="server" Width="300px"

                     DisplayModeFormat="dd/MM/yyyy HH:mm tt"

                     EditModeFormat="dd/MM/yyyy HH:mm  tt"

                     Fields="2010-9-28-16-59-0-0">
              </ig:WebDateTimeEditor>

 

 

However, the text property will return the text based on the Specific Culture Set, disregarding the tt portion AM/PM.
What is more, it will allow you to enter 24h based input and AM/PM I correctly updated.I am attaching a code sample you can refer to. Please let me know in case you have any questions or concerns regarding this matter.

 

0
Ivaylo Ganchev
Ivaylo Ganchev answered on Jul 15, 2016 8:36 AM

Hello, 

In case you want to attach to one of the editor’s events, you can do this via the EditorClientEvents class where all of these are listed. Additionally, you can pass the event handler function by name and specify the function itself in the script tag. For example: 

                        @(Html.Infragistics().TextEditorFor(m => m.Customers.FirstOrDefault().Name)
                         .ID("textEditor1")
                         .AddClientEvent(EditorClientEvents.ValueChanged, "toggleReadonly")
                         .Render()
                        ) 

            <script>
                        function toggleReadonly(evt, ui) {
                                    $("#textEditor1").igTextEditor("option", "readOnly", true); 
                                    $("#textEditor2").igTextEditor("option", "readOnly", true); 
                        }
            </script> 

What is more, when using the MVC wrappers, you can attach to the valueChanged event using the following syntaxes as well:

                        @(Html.Infragistics().TextEditorFor(m => m.Customers.FirstOrDefault().Name)
                         .ID("textEditor2")
                         .AddClientEvent("valueChanged", "toggleReadonly")
                         .Render()
                        )

Note: For the first parameter of the AddClientEvent method, do not confuse the option name of the event for the string used when binding with the jQuery event API, e.g. on, delegate, and live. The string that should be entered as the argument for the AddClientEvent method is the name of the option used to configure the event when instantiating with the jQuery UI widget in JavaScript. 

I believe you will find the following topic helping you get better understanding of using the MVC wrapper, as more details are shared:
http://www.igniteui.com/help/defining-events-with-aspnet-helper

 

0
Ivaylo Ganchev
Ivaylo Ganchev answered on Mar 22, 2016 2:42 PM

Hello,

It is possible to access the igDatePicker value through the FormCollection, and yet in the context of MVC, it could be considered
not the native/expected approach
. To do so, it will require to manually set the InputName to be (“txtDatePicker”) when instantiating the editor, because trough this collection you have access to the rendered input names and not to the id of an instantiated widget. For example:  

In the View:

<form action="/Home/GetDatePickerDate" method="post" name="form1">  
  <h3> Get the DatePicker Value using model </h3>
  @(Html.Infragistics().DatePickerFor(m => m.Customers.FirstOrDefault().Birthdate)
   .DataMode(DateTimeEditorDataMode.Date)
   .ID("datePicker1")
   .Render()
  )
  <br />
  <input type="submit" />
 </form>
 <br /> 
 <br />    
 <form action="/Home/GetDatePickerDateUsingFormCollection" method="post" name="form2">
  <h3> Get the DatePicker Value using FormCollection </h3>
 
  <h3> InputName "datePickerWithInputName"</h3>
  @(Html.Infragistics().DatePickerFor(m => m.Customers.FirstOrDefault().Birthdate).InputName("datePickerWithInputName")
   .DataMode(DateTimeEditorDataMode.Date)
   .ID("datePickerWithInputName")
   .Render()
  )
  <br />
  <h3> Some Comparison to native Inputs - accessible by name from FormCollection in the controller </h3> 
  @Html.CheckBox("Ckbx1")
  <input type="submit" />
 </form>

However, it you could consider passing the model to the controller instead, and thus having access to the value in the same DateTime format it is bound to (assuming you have bound the igDatePicker to a model with DateTime property). 

I am attaching a code sample where GetDatePickerDate Action will be used to access the datePicker values. You could compare it with GetDatePickerDateUsingFormCollection and see the different approach. 

     public ActionResult GetDatePickerDateUsingFormCollection(FormCollection form2)
             {
                     //accessing formCollection
                     string dpValue = Request.Form["datePickerWithInputName"];
                     var ckbValue = form2["Ckbx1"];
                     ViewBag.dpValueVB = dpValue;
                     ViewBag.ckbValueVB = ckbValue;
                     return View();
              }

 
             public ActionResult GetDatePickerDate(Customer customer)
              {
                     string datePicker1SelectedDate = HttpContext.Request.Params.Get("Birthdate");
                     ViewBag.Date = datePicker1SelectedDate;
                     ViewBag.myCustomerModel = customer;
                     return View();
              }

 

Additionally, you could access the value through the HttpContext.Request.Params. as shown above.

InfragisticsMvcApp1

0
Ivaylo Ganchev
Ivaylo Ganchev answered on Dec 18, 2015 3:03 PM

Hello,

n order to visually see the change when you select an item and the corresponding css be applied to this item, instead of just internally marking it as selected, you could achieve this using the select() method on the desired item. Please notice, currently it is best to use the items index to manipulate them so you could consider using something like the approach described in the following threads.

 

http://ko.infragistics.com/community/forums/t/51039.aspx
http://ko.infragistics.com/community/forums/t/30177.aspx

0
Ivaylo Ganchev
Ivaylo Ganchev answered on Dec 17, 2015 2:24 PM

Hello,
you are experiencing the default behavior. When using the keyboard to select the next item, the selection will always start from the first item in the available list of items. I will further investigate the possibilities to work around this and come back to you with more details.

0
Ivaylo Ganchev
Ivaylo Ganchev answered on Nov 23, 2015 7:27 AM

Hello, 

I believe this to be registry related issue.

So, it should be possible to use Registry to fix it.
You could try using regedit.
1.Click on the "Start" button, and then click on "Run." In the dialog box that appears, type "regedit" into the text box, and then click the "OK" button.
2.Navigate to
HKEY_CLASSES_ROOT\Applications\EXCEL.EXE\shell\open\command
3. change to Office14. 

In case the above does not work for you, here are a couple of related resources containing more fix options:
1) http://answers.microsoft.com/en-us/office/forum/office_2010-excel/excel-troubles-xlsx-files-just-wont-open-on-double/2828f328-13ba-48cf-a0b8-fb8a927c 71e5?page=2
2) https://community.spiceworks.com/topic/246692-excel-2010-can-t-open-xlsx-files-only-xls
3) Excel 2013 Pro won't open files when double -clicking the file. 

 Please let me know how these suggestions work for you.

0
Ivaylo Ganchev
Ivaylo Ganchev answered on Nov 11, 2015 12:24 PM

Hello, 

You could access the selected date via the HttpContext like
string datePicker1SelectedDate = HttpContext.Request.Params.Get("Birthdate"), for example.
I have used a form and a location where to post to like: 

    <form action="/Home/GetDatePickerDate" method="post">
        <input type="submit" />
        <h3> DatePickerFor Editor</h3>
        @(Html.Infragistics().DatePickerFor(m => m.Customers.FirstOrDefault().Birthdate)
         .DataMode(DateTimeEditorDataMode.Date)
         .ID("datePicker1")
         .Render()
        )
    </form>

I am attaching the code sample illustrating this approach. You could refer to it for details. What is more,I have removed Infragistics.Web.Mvc.dll from the Bin folder, so you could reference it locally to run the project.