Take the 2-minute tour ×

I have a devexpress calendar. The calendar has built in functions for grouping calendar by resource(which is location in my case). SO, I wrote my logic for making the calendar group by class name and provider too. The two work good individually. But when i was trying to place a radiobutton list so that user can select the way he want to group calendar,i had a problem.

This my radio button list and code behind event handler for it:

  protected  void filtertype_changed(object sender, EventArgs e)
    if (filtertype.SelectedValue == "None")
       // ASPxScheduler1.AppointmentDataSource = LoadAppointments();

        classList.Visible = false;
        providerslist.Visible = false;
        classList.SelectedIndex = 0;
        classList.SelectedIndex = 0;
        //classList.SelectedValue = "0";
        //providerslist.SelectedValue = "0"; 
      ASPxScheduler1.GroupType = DevExpress.XtraScheduler.SchedulerGroupType.None;

    else if (filtertype.SelectedValue == "Location")
       // ASPxScheduler1.Dispose();

        classList.Visible = false;
        providerslist.Visible = false;

        ASPxScheduler1.GroupType =   
        ASPxScheduler1.GroupType = DevExpress.XtraScheduler.SchedulerGroupType.None;
        classList.Visible = true;
        providerslist.Visible = true;

This is my mark up for radio button

  <asp:RadioButtonList ID="filtertype" runat="server" 
     OnSelectedIndexChanged="filtertype_changed" AutoPostBack="true" >
    <asp:ListItem selected="true" Text="None" Value="None"></asp:ListItem>
  <asp:ListItem Text="Location" Value="Location"></asp:ListItem>
  <asp:ListItem>class Name and Provider</asp:ListItem>

    <asp:DropDownList  ID="classList" runat="server" AutoPostBack="true" 
     Visible="false" ></asp:DropDownList>
<asp:DropDownList ID="providerslist" runat="server" AutoPostBack="true" Visible="false"  

classList and Provider List are the dropdownlists. So, what happens is when I change from Class and Provider radio button to location or none radio button, the calendar wont get refreshed and stores the values as per the dropdownlist and groups the calendar by location for those values only. So, once I change from classname and providers, I need to clear the dropdownlist values to 0(no item just white space). Can u just let me know how i can do this?

share|improve this question
add comment

1 Answer

Throwing out the obvious here, but what about?:

share|improve this answer
it doesn't work the first time i change radio button selection. But after that it works.. So, any idea? –  user838359 Sep 14 '11 at 18:22
Is the RadioButtonList created dynamically? If so, make sure to create it OnInit. –  James Johnson Sep 14 '11 at 18:23
i tried in Oninit too but still doen't run the first time –  user838359 Sep 14 '11 at 18:30
Can you post the markup for the RadioButtonList? –  James Johnson Sep 14 '11 at 18:35
I updated the post –  user838359 Sep 14 '11 at 18:38
add comment

Your Answer


