public void InstantiateIn(Control container) { if (null != container) { // Create the panel using (Panel categoryPanel = new Panel()) { categoryPanel.ID = "CategoriesDropDownPanel"; categoryPanel.Width = Unit.Percentage(100); categoryPanel.DataBinding += new EventHandler(CategoryPanel_DataBinding); // Create the checkbox using (CheckBox checkBox = new CheckBox()) { checkBox.ID = "CategoriesDropDownCheckBox"; checkBox.Text = "Category"; checkBox.DataBinding += new EventHandler(CheckBox_DataBinding); categoryPanel.Controls.Add(checkBox); } container.Controls.Add(categoryPanel); } } }private void CategoryPanel_DataBinding(object sender, EventArgs e){ // TODO: Never gets called! Panel target = (Panel)sender; RadComboBoxItem container = (RadComboBoxItem)target.BindingContainer; Category category = (Category)container.DataItem; target.BackColor = System.Drawing.Color.FromArgb(category.Color);}private void CheckBox_DataBinding(object sender, EventArgs e){ // TODO: Never gets called! CheckBox target = (CheckBox)sender; RadComboBoxItem container = (RadComboBoxItem)target.BindingContainer; target.Text = (string)DataBinder.Eval(container.DataItem, "Name");}using System;using System.Globalization;using System.Collections;using System.ComponentModel;using System.Web.UI;using System.Web.UI.WebControls;using Telerik.Web.UI;using System.Collections.ObjectModel;using System.Web.UI.HtmlControls;using System.Data;using CategoryDropDownTest.Entities;namespace CategoryDropDownTest.CustomControls{ /// <summary> /// USG Web Server Control for displaying a category dropdown in a website /// </summary> [ToolboxData("<{0}:CategoryDropDown runat=server></{0}:CategoryDropDown>"), /*ParseChildren(false),*/ ParseChildren(ChildrenAsProperties = true), PersistChildren(false), DefaultProperty("Text")] public class CategoryDropDown : CompositeControl, INamingContainer { #region Private Members private RadComboBox radCategoryDropDown; private Collection<Category> items = new Collection<Category>(); #endregion #region Public Properties /// <summary> /// gets the collection of Category /// </summary> [DesignerSerializationVisibility(DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty), MergableProperty(false), Category("CategoryDropDown Properties"), Description("Categories of the dropdown menu.")] public Collection<Category> Items { get { return items; } } /// <summary> /// Gets or sets the Text to be displayed /// </summary> [Category("CategoryDropDown Properties"), Description("Text for the categoryDropDown")] public string Text { get; set; } #endregion #region Overriden Methods #region RenderContents /// <summary> /// Overridden RenderContents /// </summary> /// <param name="writer">HmltTextWriter parameter</param> protected override void RenderContents(HtmlTextWriter writer) { if (this.DesignMode) { // In design mode, display only the id if (writer != null) writer.WriteLine(this.ID); } else { } base.RenderContents(writer); } #endregion #region OnInit /// <summary> /// Overridden OnInit /// </summary> /// <param name="e">EventArfs parameter</param> protected override void OnInit(EventArgs e) { // Initialize the controls this.InitControl(); base.OnInit(e); } #endregion #region OnLoad /// <summary> /// Overriden OnLoad /// </summary> /// <param name="e">EventArgs parameter</param> protected override void OnLoad(EventArgs e) { // Load the control this.LoadControl(); base.OnLoad(e); } #endregion #endregion #region Private Methods /// <summary> /// Initialize the control /// </summary> private void InitControl() { // Create the RadCategoryDropDown this.radCategoryDropDown = new RadComboBox(); } #region LoadControl /// <summary> /// Load the control /// </summary> private void LoadControl() { // Set fixed properties //this.radCategoryDropDown.HeaderTemplate = new HeaderTemplate(); this.radCategoryDropDown.ItemTemplate = new ItemTemplate(); this.radCategoryDropDown.ChangeTextOnKeyBoardNavigation = false; this.radCategoryDropDown.EnableTextSelection = false; this.radCategoryDropDown.HighlightTemplatedItems = true; this.radCategoryDropDown.EnableViewState = false; // Bind the events this.radCategoryDropDown.ItemDataBound += new RadComboBoxItemEventHandler(RadCategoryDropDown_ItemDataBound); // Add the properties this.radCategoryDropDown.Text = this.Text; if ((null != this.items) && (this.items.Count > 0)) { this.radCategoryDropDown.DataSource = this.items; this.radCategoryDropDown.DataTextField = "Name"; this.radCategoryDropDown.DataValueField = "Id"; this.radCategoryDropDown.DataBind(); } // Add the control this.Controls.Add(radCategoryDropDown); } #endregion #region Events /// <summary> /// ItemDataBound event of the radCategoryDropDown /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void RadCategoryDropDown_ItemDataBound(object sender, RadComboBoxItemEventArgs e) { if (e != null) { // Get the category Category category = (Category) e.Item.DataItem; // Find the panel Panel itemPanel = (Panel)e.Item.FindControl("CategoriesDropDownPanel"); if (null != itemPanel) { // TODO: Check if it can be added through the item template //itemPanel.BackColor = System.Drawing.Color.FromArgb(category.Color); // Find the checkbox CheckBox itemCheckBox = (CheckBox) itemPanel.FindControl("CategoriesDropDownCheckBox"); if (null != itemPanel) { // TODO: Remove, should be added through the item template //itemCheckBox.Text = category.Name; } } } } #endregion #endregion }}I'm sure I'm missing something simple here! I want to load content from my database into several tabs. I have the standard RadTabStrip and RadMultiPage element set up in the aspx code.
In my backend VB code I want to add several tabs. I have this so far:
| Dim tab As RadTab = New RadTab |
| Me.TabStrip.Tabs.Add(tab) |
| tab.Text = "Tab #3" |
| ' this bit is not doing anything at present |
| Dim pageView As RadPageView = New RadPageView |
| Me.TabPages.PageViews.Add(pageView) |
The tab gets added to the tab strip, but when I click it there is no content area. I've looked through all the examples and haven't seen anything that actually adds the tab content, only the tabs. Can anyone help?
<telerik:RadGrid ID="RadGridContainers" runat="server" Skin="Office2007" AllowSorting="True"
GridLines="None" AllowMultiRowSelection="True" OnNeedDataSource="RadGridContainers_NeedDataSource"
Width="800px" Visible="False" ShowStatusBar="True" OnItemCommand="RadGridContainers_ItemCommand"
OnCancelCommand="RadGridContainers_CancelCommand"
AutoGenerateColumns="False"
onitemdatabound="RadGridContainers_ItemDataBound">
<MasterTableView AllowMultiColumnSorting="True" CommandItemDisplay="Top"
DataKeyNames="ContainerID" EditMode="InPlace">
<CommandItemSettings AddNewRecordText="Tilfj ny container" RefreshText="Opdatr" />
<Columns>
<telerik:GridEditCommandColumn CancelText="Annullr" InsertText="Indst" UpdateText="Opdatr"
EditText="Redigr">
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn DataField="ContainerID" DataType="System.Int32" HeaderText="ContainerID"
ReadOnly="True" SortExpression="ContainerID" UniqueName="ContainerID" Visible="False">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn DataField="ContainerIDParent" DataType="System.Int32"
HeaderText="Forldre" SortExpression="ContainerIDParent" UniqueName="ContainerIDParent"
Visible="True">
<EditItemTemplate>
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<img id="rcbContainerIDParentEditImage" src='<%= ImageController.Instance.ImagePathTreeViewRaw %><%# Eval("mapviewer_Container1.mapviewer_Icon.Icon")%>'
alt="" width="16px" height="16px" />
</td>
<td align="left">
<telerik:RadComboBox ID="rcbContainerIDParent" runat="server" Skin="Office2007" MarkFirstMatch="True"
HighlightTemplatedItems="True" DropDownWidth="500px" Height="200px" DataSourceID="LinqDataSource7"
DataTextField="Name" Width="204px" DataValueField="ContainerID"
OnClientSelectedIndexChanged="rcbContainerIDParentSelectedIndexChanged" SelectedValue='<%# Bind("mapviewer_Container1.ContainerID") %>'>
<CollapseAnimation Duration="200" Type="OutQuint" />
<HeaderTemplate>
<table cellpadding="0" cellspacing="0" style="width: 290px;">
<tr>
<td style="width: 30px;">
Id
</td>
<td style="width: 60px">
Billede
</td>
<td style="width: 200px;">
Navn
</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table cellpadding="0" cellspacing="0" style="width: 290px;">
<tr>
<td style="width: 30px;">
<%# Eval("ContainerID")%>
</td>
<td style="width: 60px;">
<img src='<%= ImageController.Instance.ImagePathTreeViewRaw %><%# Eval("mapviewer_Icon.Icon")%>'
alt="" width="16px" height="16px" />
</td>
<td style="width: 200px;">
<%# Eval("Name")%>
</td>
</tr>
</table>
</ItemTemplate>
</telerik:RadComboBox>
</td>
</tr>
</table>
</EditItemTemplate>
<ItemTemplate>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="border: 0;">
<asp:Image ID="rcbIkonEditImageContainer" ImageUrl='<%# ImageController.Instance.ImagePathTreeViewForGridView((string)Eval("mapviewer_container1.mapviewer_Icon.Icon"))%>'
runat="server" Width="16px" Height="16px" />
</td>
<td style="border: 0;">
<asp:Label ID="ContainerIDLabel" runat="server" Text='<%# Eval("mapviewer_container1.Name") %>'></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="Name" HeaderText="Navn" SortExpression="Name"
UniqueName="Name">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Level" DataType="System.Int32" HeaderText="Level"
SortExpression="Level" UniqueName="Level" Visible="False">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn DataField="IconID" DataType="System.Int32" HeaderText="Ikon"
SortExpression="IconID" UniqueName="IconID" Visible="True">
<EditItemTemplate>
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<img id="rcbIkonEditImage" src='<%= ImageController.Instance.ImagePathTreeViewRaw %><%# Eval("mapviewer_Icon.Icon")%>'
alt="" width="16px" height="16px" />
</td>
<td align="left">
<telerik:RadComboBox ID="rcbIkon" runat="server" Skin="Office2007" MarkFirstMatch="True"
HighlightTemplatedItems="True" DropDownWidth="500px" Height="200px" DataSourceID="LinqDataSource1"
DataTextField="Icon" Width="204px" DataValueField="IconID"
OnClientSelectedIndexChanged="rcbIkonSelectedIndexChanged" SelectedValue='<%# Bind("mapviewer_Icon.IconID") %>'>
<CollapseAnimation Duration="200" Type="OutQuint" />
<HeaderTemplate>
<table cellpadding="0" cellspacing="0" style="width: 190px;">
<tr>
<td style="width: 30px;">
Id
</td>
<td style="width: 60px;">
Billede
</td>
<td style="width: 100px">
Filnavn
</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table cellpadding="0" cellspacing="0" style="width: 190px;">
<tr>
<td style="width: 30px;">
<%# Eval("IconID")%>
</td>
<td style="width: 60px;">
<img src='<%= ImageController.Instance.ImagePathTreeViewRaw %><%# Eval("Icon")%>'
alt="" width="16px" height="16px" />
</td>
<td style="width: 100px;">
<%# Eval("Icon")%>
</td>
</tr>
</table>
</ItemTemplate>
</telerik:RadComboBox>
</td>
</tr>
</table>
</EditItemTemplate>
<ItemTemplate>
<img src='<%= ImageController.Instance.ImagePathTreeViewRaw %><%# Eval("mapviewer_Icon.Icon")%>'
alt="" width="16px" height="16px" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridCheckBoxColumn DataField="Enabled" DataType="System.Boolean" HeaderText="Aktiv"
SortExpression="Enabled" UniqueName="Enabled">
</telerik:GridCheckBoxColumn>
<telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Fjern" CommandName="Delete" />
</Columns>
<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn1">
</EditColumn>
</EditFormSettings>
</MasterTableView>
<ClientSettings>
<Selecting AllowRowSelect="True" />
</ClientSettings>
</telerik:RadGrid>
protected
void RadGridContainers_ItemCommand(object source, GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.InitInsertCommandName)
{
e.Canceled =
true;
System.Collections.Specialized.ListDictionary newValues = new System.Collections.Specialized.ListDictionary();
layerDataClassesDataContext =
new LayerDataClassesDataContext();
newValues[
"mapviewer_Container1.mapviewer_Icon.Icon"] = layerDataClassesDataContext.mapviewer_Icons.First(i => i.IconID.Equals(6));
newValues[
"mapviewer_Container1"] = layerDataClassesDataContext.mapviewer_Containers.First(c => c.ContainerIDParent.Equals(null));
newValues[
"mapviewer_Icon.Icon"] = layerDataClassesDataContext.mapviewer_Icons.First(i => i.IconID.Equals(6)).Icon;
newValues[
"mapviewer_Icon"] = layerDataClassesDataContext.mapviewer_Icons.First(i => i.IconID.Equals(6));
e.Item.OwnerTableView.InsertItem(newValues);
//layerDataClassesDataContext = new LayerDataClassesDataContext();
//mapviewer_Container container = new mapviewer_Container();
//container.mapviewer_Container1 = layerDataClassesDataContext.mapviewer_Containers.First(c => c.ContainerIDParent.Equals(null));
//container.mapviewer_Icon = layerDataClassesDataContext.mapviewer_Icons.First(i => i.IconID.Equals(6));
//e.Item.OwnerTableView.InsertItem(container);
}
}
MSI (s) (A4:BC) [09:43:58:033]: Executing op: ActionStart(Name=InstallSPSolution,,)
Action 9:43:58: InstallSPSolution.
MSI (s) (A4:BC) [09:43:58:096]: Executing op: CustomActionSchedule(Action=InstallSPSolution,ActionType=3073,Source=BinaryData,Target=InstallSPSolution,CustomActionData=RadControlsSP.wsp)
MSI (s) (A4:58) [09:43:58:189]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIC10B.tmp, Entrypoint: InstallSPSolution
MSI (s) (A4:F4) [09:43:58:189]: Generating random cookie.
MSI (s) (A4:F4) [09:43:58:189]: Created Custom Action Server with PID 5540 (0x15A4).
MSI (s) (A4:BC) [09:43:58:252]: Running as a service.
MSI (s) (A4:BC) [09:43:58:267]: Hello, I'm your 64bit Elevated custom action server.
SFXCA: Extracting custom action to temporary directory: C:\Windows\Installer\MSIC10B.tmp-\
SFXCA: Binding to CLR version v2.0.50727
Calling custom action DeployWspOnSharepointCustomAction!DeployWspOnSharepointCustomAction.CustomAction.InstallSPSolution
Begin installing Sharepoint solution.
Exception thrown by custom action:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Management.Automation.CmdletInvocationException: Cannot access the local farm.
Verify that the local farm is properly configured, currently available, and that you have the appropriate permissions to access the database before trying again. --->
Microsoft.SharePoint.PowerShell.SPCmdletException: Cannot access the local farm. Verify that the local farm is properly configured, currently available, and that you have the appropriate
permissions to access the database before trying again.
at Microsoft.SharePoint.PowerShell.SPCmdlet.BeginProcessing()
--- End of inner exception stack trace ---
at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)
at System.Management.Automation.PipelineNode.Execute(Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)
at System.Management.Automation.StatementListNode.ExecuteStatement(ParseTreeNode statement, Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
at Microsoft.Deployment.WindowsInstaller.CustomActionProxy.InvokeCustomAction(Int32 sessionHandle, String entryPoint, IntPtr remotingDelegatePtr)
CustomAction InstallSPSolution returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 9:44:02: InstallFinalize. Return value 3.
MSI (s) (A4:BC) [09:44:02:783]: User policy value 'DisableRollback' is 0
MSI (s) (A4:BC) [09:44:02:783]: Machine policy value 'DisableRollback' is 0
Itemselector.ascx <cc:CmsUrlWebEditor id="cmsUrlWebEditor" runat="server" />
<%@ Register TagPrefix="cc" Namespace="Telerik.Cms.Web.UI" Assembly="Telerik.Cms" %>