<
telerik:RadWindowManager
ID
=
"RadWindowManager1"
runat
=
"server"
>
<
Windows
>
<
telerik:RadWindow
runat
=
"server"
Width
=
"600px"
Height
=
"550px"
VisibleStatusbar
=
"false"
style
=
"z-index:10000;"
ID
=
"ExplorerWindow"
Modal
=
"true"
Behaviors
=
"Default"
>
</
telerik:RadWindow
>
</
Windows
>
</
telerik:RadWindowManager
>
if (e.CommandName == RadGrid.FilterCommandName)
{
Pair filterPair = (Pair)e.CommandArgument;
if (filterPair.Second.ToString() == "DateCreated")
{
string colName = filterPair.Second.ToString();
TextBox tbPattern = (e.Item as GridFilteringItem)[colName].Controls[0] as TextBox;
string[] values = tbPattern.Text.Split(' ');
if (values.Length == 2)
{
e.Canceled = true;
string newFilter = "(([" + filterPair.Second + "] >='" + values[0] + "') AND ([" + filterPair.Second + "] <='" + values[1] + "'))";
if (taskGrid.MasterTableView.FilterExpression == "")
{
taskGrid.MasterTableView.FilterExpression = "('" + startDate1.Value.ToString("MM/dd/yyyy HH:mm:ss") + "' <= [DateCreated] AND [DateCreated] <= '" + endDate1.Value.ToString("MM/dd/yyyy HH:mm:ss") + "')" + newFilter;
}
else
{
taskGrid.MasterTableView.FilterExpression += " AND ('" + startDate1.Value.ToString("MM/dd/yyyy HH:mm:ss") + "' <= [DateCreated] AND [DateCreated] <= '" + endDate1.Value.ToString("MM/dd/yyyy HH:mm:ss") + "' )";
}
}
}
}
function
OnRequestStart(sender, args) {
//get a reference to the current RadWindow
var
oWnd = GetRadWindow();
args.set_eventArgument(oWnd[
"EmailAddress"
]);
}
<telerik:RadPanelBar ID="RadPanelBar1" runat="server">
<Items>
<telerik:RadPanelItem runat="server" Text="Activities">
<Items>
<telerik:RadPanelItem runat="server" Value="templateHolder">
<ItemTemplate>
<asp:CheckBox ID="CheckBox2" runat="server" />
</ItemTemplate>
</telerik:RadPanelItem>
</Items>
</telerik:RadPanelItem>
</Items>
</telerik:RadPanelBar>
This is my .ascx.cs file:
public override void DoLayout( )
{
//Get collection
TrackableCollection<ProjectActivityBooking> acitivities = existingRegistration.ProjectParticipant.ProjectEntity.ProjectActivityBooking;
//Here it is possible to get hold of the checkbox
CheckBox cb = RadPanelBar1.FindItemByValue("templateHolder").FindControl("CheckBox2") as CheckBox;
//Add datasource and bind
this.RadPanelBar1.ItemDataBound += new RadPanelBarEventHandler(itemDatabound);
this.RadPanelBar1.DataSource = acitivities;
this.RadPanelBar1.DataBind();
}
The code below let me add a new instatited CheckBox, but it is not added as subitem. Instead I´m getting a "static" RadPanelBar without the nice feature of being pushed and sliding out the subitems ie. activities
void itemDatabound(Object sender, RadPanelBarEventArgs e)
{
//Get panelItem
RadPanelItem item = (RadPanelItem)e.Item;
//Create Checkbox
CheckBox chk = new CheckBox();
//Get Activity
ProjectActivityBooking activity = item.DataItem as ProjectActivityBooking;
//Set activity name
chk.Text = activity.ProjectActivity.ActivityName;
//Add control
item.Controls.Add(chk);
}
I think the way forward is something like below, but that will not get me my CheckBox.
void itemDatabound(Object sender, RadPanelBarEventArgs e)
{
//This will throw an exception
//CheckBox cb1 = RadPanelBar1.FindItemByValue("templateHolder").FindControl("CheckBox2") as CheckBox;
//This will return null as it will now find the templateHolder RadPanel item
//How will I then get hold of the CheckBox2 when the templateholder do not find/returns null
//RadPanelItem item = e.Item.FindControl("templateHolder") as RadPanelItem;
}
Please let me know what I´ve done wrong?
Best Regards,
Thomas Andersson