Monday should always be selected in date calendar cells

Posted by: anand-r on 8 September 2017, 3:01 pm EST

  • Posted 8 September 2017, 3:01 pm EST

    Hi Team

    We have a scenerio where we need Monday should always be selected in date calendar cells.  example say we have a column header as "insertion week of" date calender cells where Monday should always be selected.  If we select other than Monday then we need to show up a message saying that other days are not selected.  How it can be done using DateCalendarCellType.  

     

    BTW, we are using asp.net 5 for spread.  Could anyone help us how to do this?   

     Thanks in advance

    Anand R 

  • Replied 8 September 2017, 3:01 pm EST

    Hi

    Thanks.  I'll let you know once it is working or not.

     

    BTW, Is this developed in asp.net 3.5.  Actually we are using asp.net 3.5.

    Can i a sample code as when the user selects or input wrong data in a cell and how an alert is displayed.?

    Thanks,

    Anand R 

  • Replied 8 September 2017, 3:01 pm EST

    Hello,

    Thank you for the elaboration. I am working on your query. I will get back to you soon.

    Thanks,

    Manpreet Kaur

  • Replied 8 September 2017, 3:01 pm EST

    hi,

    thanks for replying.

     Actually we need  "if the user selects any other date that does not falls on Monday then it should display no days are selected and should not select any date."

     

    Thanks in advance

    Anand R 

  • Replied 8 September 2017, 3:01 pm EST

    Hello,

    Could you please elaborate your query further. Do you want any date which comes on Monday in that specific month to be selected as soon as the calendar is dropped down, and if the user selects any other date that does not falls on Monday then it should display no days are selected and should not select any date. It would be helpful if you could provide me with some screenshots depicting your requirement so that I can guide you ahead with the same.

    Thanks,

    Manpreet Kaur

  • Replied 8 September 2017, 3:01 pm EST

    Hello,

    The attached project is developed in .NET4.0 framework, but would work for .NetFramework3.5 too.  The attached project has all the code on how exactly the wrong input by the user is handled by doing a cllback on the server side and handling the same in the  ButtonCommand event and at the end displaying the alert by using the CallBackStopped client side event. Hope it will help you. Please let me know if I missed something or if you have any queries further.

    Thanks,

    Manpreet Kaur

  • Replied 8 September 2017, 3:01 pm EST

    Hello,

    Please have a look at the attached sample that fulfills your requirement i.e as soon as the user selects a date and leaves the cell, then if the date does not falls on Monday the cell value is set to null and an alert is displayed. Hope it will help you. Please let me know if you have any queries further.

    Thanks,

    Manpreet Kaur


    2012/10/SelectMonday.zip
  • Replied 8 September 2017, 3:01 pm EST

    hi,


    thanks for the reply. 

     

    I am getting error when i try to incorporate your code in my project.  The error is "object reference is not set to an instance of an object" in fpspread1_button function (string s = fpspread1.activesheet.....)

    Please advice

    Anand R 

  • Replied 8 September 2017, 3:01 pm EST

    Hello,

    Could you please provide me with your sample application depicting the issue so that I can look into it further.

    Thanks,

    Manpreet Kaur

  • Replied 8 September 2017, 3:01 pm EST

    Hi Manpreet Kaur,

    Thanks for replying and your code is working fine.

    Let me give some details of my requirements.

    We are populating column headers like name, address, phone, date of birth, week of from the database.  We have like around 80 columns showing in the Spread.  I need the particular column headers cells which is ajax calendar control (if click textbox calendar control would showup).  Say the name of the column is "week_of " which i need to show message when others dates are selected without clicking any other button.  how to achieve this.

    Thanks

    Anand R 

  • Replied 8 September 2017, 3:01 pm EST

    Hello,

    I am working on your query, I will get back to you soon.

    Thanks,

    Manpreet Kaur

  • Replied 8 September 2017, 3:01 pm EST

    hi,

     

    we are using spread version 5.0.  is because of version not working.

    Thanks

    Anand R 

  • Replied 8 September 2017, 3:01 pm EST

    Hello,

    The sample is working at my end, I tested the same in IE9. Could you please try executing the same sample at your end to see if it works or not, before incorporating the code in your project.  If the sample is working fine then I would request you to provide me with your project depicting the issue as it would be difficult to get to the cause of the issue without replicating the same at my end. I would also like to know which browser are you currently facing the issue with. Please provide me with the necessary information so that I can replicate the issue at my end and debug it further.

    Thanks,

    Manpreet Kaur

  • Replied 8 September 2017, 3:01 pm EST

    Hello,

    Please have a look at the attached sample that fulfills your requirement of performing the date validation without having to leave the cell or click on any other cell i.e as soon as the date is selected from the calendar. Hope it will help you. Please let me know if you have any queries further.

    Thanks,

    Manpreet Kaur


    2012/11/SelectMondayCal.zip
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels