This is a migrated thread and some comments may be shown as answers.

How do i get the column header selected state in a radcalendar?

1 Answer 43 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Vithiya
Top achievements
Rank 1
Vithiya asked on 24 Feb 2010, 03:28 PM
I have a radcalendar that has EnableMultiSelect="true" and UseColumnHeadersAsSelectors="true". When a user clicks on the column header, I need to know if the click is going to select or deselect the dates. OnDateClick event has a get_isSelected() method I can use to determine if the clicked date is selected or not selected. Similarly, I want to know if the column header click is to select or deselect the respective dates.

Thank you,
Vithiya

1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 26 Feb 2010, 01:58 PM
Hello Vithiya,

When the RadCalendar.UseColumnHeadersAsSelectors property is set to true and user clicks on the header all dates under the header are selected, not the header item. So the header item does not keep any state for selection.

To achieve the desired functionality you could try the following approach:
When the user clicks on the header's item you could handle the OnDateSelected event and set a boolean flag to the value returned from eventArgs.get_renderDay().get_isSelected() method. In that way you could know if the dates under the header item is selected or deselected:

<script type="text/javascript">
 var isHeaderSelectDates = false;
 function onDateSelected(sender, eventArgs) {
      isHeaderSelectDates= eventArgs.get_renderDay().get_isSelected();
 }
 
 function onColumnHeaderClick(sender, eventArgs) {
   setTimeout(function() {
      if (isHeaderSelectDates) {
          alert("Selecting dates");
      }
      else {
          alert("Deselecting dates");
      }
   }, 30);
}
</script>

Also I attached a small runnable application which demonstrates how to achieve the desired scenario.

I hope this helps.

Greetings,
Radoslav
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Calendar
Asked by
Vithiya
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or