2
我有一個devexpress日曆。日曆內置了按資源對日曆進行分組的功能(這是我的情況中的位置)。所以,我寫了我的邏輯來按類名和提供者來創建日曆組。這兩人單獨工作。但是,當我試圖放置一個單選按鈕列表,以便用戶可以選擇他想要分組日曆的方式時,我遇到了問題。清除下拉式單選按鈕選定索引
這是我的單選按鈕,列表和事件處理代碼隱藏它:
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 =
DevExpress.XtraScheduler.SchedulerGroupType.Resource;
}
else
{
ASPxScheduler1.GroupType = DevExpress.XtraScheduler.SchedulerGroupType.None;
classList.Visible = true;
providerslist.Visible = true;
}
}
這是我的印記,彌補單選按鈕
<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:RadioButtonList>
<asp:DropDownList ID="classList" runat="server" AutoPostBack="true"
Visible="false" ></asp:DropDownList>
<asp:DropDownList ID="providerslist" runat="server" AutoPostBack="true" Visible="false"
></asp:DropDownList>
班級名冊和提供商列表中是dropdownlists。所以,當我從Class和Provider單選按鈕更改爲位置或無單選按鈕時,會發生什麼情況,日曆將不會刷新並按照下拉列表存儲值,並且僅按這些值的位置對日曆進行分組。所以,一旦我從classname和providers改變,我需要清除下拉列表值爲0(沒有項目只是空白)。你能讓我知道我該怎麼做?
它不工作,我第一次改變單選按鈕的選擇。但之後,它的工作..所以,任何想法? – user838359
是否動態創建RadioButtonList?如果是這樣,請確保創建它'OnInit'。 –
我也在Oninit試過,但仍然沒有第一次運行 – user838359