Hi,
Lately I've been working on a user control to represent a week (Week User Control). This User Control contains, based on settings, 5, 6 or 7 days:
In my Default.aspx I'm using the Week User Control, but for each day I would like to create an AjaxSetting. This AjaxSetting should have its AjaxControlID set to the RadListView object of the User Control. Why? I want to catch changes in the selection of the RadListView, so my RadRibbonBar (menu) can change its appearance. Whenever a user selects or deselects an item in a RadListView object my menu has to change its appearance (enable / disable specific buttons), but how can I accomplish this?
So, on my Default.aspx I have my RadRibbonBar object and Week User Control.
In my Week User Control (week.ascx) I have 5 to 7 Day User Controls (Monday till Friday/Saturday/Sunday).
In my Day User Control (day.ascx) I have the RadListView control which ID has to be set to the AjaxControlID in my Default.aspx.
Default.aspx:
Week User Control (week.ascx):
Day User Control (day.ascx):
The OnSelectedIndexChanged property "lvDay_SelectedIndexChanged" does the following to notify Week User Control and Default.aspx and eventually do something in the code-behind of Default.aspx in the "Week_SelectionChanged" event:
The Week_SelectionChanged event changes the appearance of the RadRibbonBar in Default.aspx.
Hopefully, you know a solution or workaround for my problem. The current solution is not eligible, because the page now postbacks after a (de)selection in a RadListView object in order to refresh the RadRibbonBar. But, I would like to only refresh the RadRibbonBar based on a (de)selection.
I'm looking forward to see your comments on this. Thanks in advance!
Regards,
Datamex
Lately I've been working on a user control to represent a week (Week User Control). This User Control contains, based on settings, 5, 6 or 7 days:
- Monday
- Tuesday
- Wednesday
- Thursday
- Friday
- (optional Saturday)
- (optional Sunday)
Each day itself is a User Control (Day User Control) too and includes a RadListView object.
In my Default.aspx I'm using the Week User Control, but for each day I would like to create an AjaxSetting. This AjaxSetting should have its AjaxControlID set to the RadListView object of the User Control. Why? I want to catch changes in the selection of the RadListView, so my RadRibbonBar (menu) can change its appearance. Whenever a user selects or deselects an item in a RadListView object my menu has to change its appearance (enable / disable specific buttons), but how can I accomplish this?
So, on my Default.aspx I have my RadRibbonBar object and Week User Control.
In my Week User Control (week.ascx) I have 5 to 7 Day User Controls (Monday till Friday/Saturday/Sunday).
In my Day User Control (day.ascx) I have the RadListView control which ID has to be set to the AjaxControlID in my Default.aspx.
Default.aspx:
<
telerik:RadRibbonBar
ID
=
"Menu"
runat
=
"server"
>
...
</
telerik:RadRibbonBar
>
<
telerik:RadAjaxLoadingPanel
ID
=
"LoadingPanel"
runat
=
"server"
/>
<
telerik:RadAjaxManagerProxy
ID
=
"AjaxManager"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"??? RadListViewID of each Day user Control ???"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"Menu"
LoadingPanelID
=
"LoadingPanel"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManagerProxy
>
<
uc1:Week
ID
=
"Week"
runat
=
"server"
OnActivitySelectionChanged
=
"Week_SelectionChanged"
/>
Week User Control (week.ascx):
<
uc1:Day
ID
=
"Sunday"
runat
=
"server"
Day
=
"Sunday"
OnActivitySelectionChanged
=
"OnActivitySelectionChanged"
/>
<
uc1:Day
ID
=
"Monday"
runat
=
"server"
Day
=
"Sunday"
OnActivitySelectionChanged
=
"OnActivitySelectionChanged"
/>
<
uc1:Day
ID
=
"Tuesday"
runat
=
"server"
Day
=
"Sunday"
OnActivitySelectionChanged
=
"OnActivitySelectionChanged"
/>
<
uc1:Day
ID
=
"Wednesday"
runat
=
"server"
Day
=
"Sunday"
OnActivitySelectionChanged
=
"OnActivitySelectionChanged"
/>
<
uc1:Day
ID
=
"Thursday"
runat
=
"server"
Day
=
"Sunday"
OnActivitySelectionChanged
=
"OnActivitySelectionChanged"
/>
<
uc1:Day
ID
=
"Friday"
runat
=
"server"
Day
=
"Sunday"
OnActivitySelectionChanged
=
"OnActivitySelectionChanged"
/>
<
uc1:Day
ID
=
"Saturday"
runat
=
"server"
Day
=
"Sunday"
OnActivitySelectionChanged
=
"OnActivitySelectionChanged"
/>
Day User Control (day.ascx):
<
telerik:RadListView
ID
=
"lvDay"
runat
=
"server"
onselectedindexchanged
=
"lvDay_SelectedIndexChanged"
AllowMultiItemSelection
=
"true"
>
</
telerik:RadListView
>
The OnSelectedIndexChanged property "lvDay_SelectedIndexChanged" does the following to notify Week User Control and Default.aspx and eventually do something in the code-behind of Default.aspx in the "Week_SelectionChanged" event:
public event EventHandler ActivitySelectionChanged;
protected void OnActivitySelectionChanged(EventArgs e)
{
if (ActivitySelectionChanged != null)
ActivitySelectionChanged(this, e);
}
protected void DayListView_SelectedIndexChanged(object sender, EventArgs e)
{
OnActivitySelectionChanged(e);
}
The Week_SelectionChanged event changes the appearance of the RadRibbonBar in Default.aspx.
Hopefully, you know a solution or workaround for my problem. The current solution is not eligible, because the page now postbacks after a (de)selection in a RadListView object in order to refresh the RadRibbonBar. But, I would like to only refresh the RadRibbonBar based on a (de)selection.
I'm looking forward to see your comments on this. Thanks in advance!
Regards,
Datamex