
dockLayoutHome_LoadDockLayout event. For the docks that I try to add on "runtime" (I have a RadAjaxPanel which contains the RadDockLayout) I get the following error:System.ApplicationException: A program is attempting to add a new Web Part Zone to this page. Web Part Zones must be defined at the time a Web Part Page is created.
Any help would be appreciated :)
public class CustomRadDock : RadDock { #region Overrides protected override void OnInit(EventArgs e) { base.OnInit(e); this.EnsureChildControls(); } protected override void CreateChildControls() { base.CreateChildControls(); WebPartZone wpZone = new WebPartZone(); wpZone.ID = String.Format("{0}_webPartZone", this.ID); wpZone.PartChromeType = System.Web.UI.WebControls.WebParts.PartChromeType.TitleOnly; this.ContentContainer.Controls.Add(wpZone); LoadWebPart("myname"); } #endregion Overrides #region Methods private void LoadWebPart(String webPartName_) { _log.Info("Adding WebPart to dock"); using (SPSite site = new SPSite("mysite")) { SPWeb web = site.RootWeb; SPFile page = web.GetFile("mypage"); web.AllowUnsafeUpdates = true; web.Update(); using (SPLimitedWebPartManager wpmgr = page.GetLimitedWebPartManager(System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared)) { XmlElement p = new XmlDocument().CreateElement("p"); p.InnerText = "Hello World"; ContentEditorWebPart cewp = new ContentEditorWebPart(); cewp.Content = p; wpmgr.AddWebPart(cewp, String.Format("{0}_webPartZone", this.ID), 0); wpmgr.SaveChanges(cewp); } web.AllowUnsafeUpdates = false; web.Update(); } } #endregion Methods
I have grid like below.i have two links Aggregate Data ,Account Data in detail table.
When i click Aggregate Data link "Type" detail table view should display and Account" detail table view should hide
When i click Account Data link Account" detail table view should display and "Type" detail table view should hide
how to show/hide type/account detail tables based on Aggregate Data link/ Account Data link clicks
< telerik:RadGrid ID="grdResult" runat="server" Width="100%" AutoGenerateColumns="False"
AllowPaging="True" Skin="DV" EnableEmbeddedSkins="false" PageSize="25" ExpandCollapseColumn-Display="false"
ExpandCollapseColumn-Visible="false">
<mastertableview width="100%" nomasterrecordstext="<%$ Resources:Generic,NoRecord %>"
pagesize="25" allowcustompaging="true" name="SourceTable">
<Columns>
------------------------
---------------------------------
</Columns>
<DetailTables>
<telerik:GridTableView Name="Site" runat="server" AllowPaging="false" PageSize="25"
ShowHeader="false" TableLayout="Auto">
<HeaderStyle BackColor="#d1d1d1" />
<Columns>
<telerik:GridBoundColumn HeaderText="" UniqueName="SiteName" DataField="SiteName"
ItemStyle-Width="100px" ItemStyle-CssClass="MasBGcolor">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn >
<ItemTemplate>
<asp:Label ID="lblDisplay" runat="server" Text="Display:" ></asp:Label>
<asp:Label ID="lblAgrData" runat="server" Text="Aggregate Data" visible="false"></asp:Label>
<asp:LinkButton ID="lnkAgrData" runat="server" CommandName="cmdAggrigate">Aggregate Data</asp:LinkButton>|
<asp:LinkButton ID="lnkAccountData" runat="server" CommandName="cmdAccount">Account Data</asp:LinkButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
<DetailTables>
<telerik:GridTableView Name="Type" runat="server" AllowPaging="false" PageSize="25" ExpandCollapseColumn-Display="false"
ExpandCollapseColumn-Visible="false" ShowHeader="false" TableLayout="Auto" >
<HeaderStyle BackColor="#d1d1d1" />
<Columns>
<telerik:GridBoundColumn HeaderText="" DataField="TypeName" UniqueName="TypeName" ItemStyle-CssClass="MasBGcolor" >
</telerik:GridBoundColumn>
</Columns>
<DetailTables>
<telerik:GridTableView Name="Details" runat="server" AllowPaging="false" PageSize="25"
ShowHeader="false" TableLayout="Auto" >
<HeaderStyle BackColor="#d1d1d1" />
<Columns>
-----------------------
------------------------------
</Columns>
</telerik:GridTableView>
</DetailTables>
</telerik:GridTableView>
<telerik:GridTableView Name="Account" runat="server" AllowPaging="false" PageSize="25"
ShowHeader="false" TableLayout="Auto">
<HeaderStyle BackColor="#d1d1d1" />
<Columns>
<telerik:GridBoundColumn HeaderText="" UniqueName="AccountName" DataField="AccountName"
ItemStyle-Width="100px" ItemStyle-CssClass="MasBGcolor">
</telerik:GridBoundColumn>
</Columns>
<DetailTables>
<telerik:GridTableView Name="AccountType" runat="server" AllowPaging="false" PageSize="25" ExpandCollapseColumn-Display="false"
ExpandCollapseColumn-Visible="false" ShowHeader="false" TableLayout="Auto" >
<HeaderStyle BackColor="#d1d1d1" />
<Columns>
<telerik:GridBoundColumn HeaderText="" DataField="TypeName" UniqueName="TypeName" ItemStyle-CssClass="MasBGcolor" >
</telerik:GridBoundColumn>
</Columns>
<DetailTables>
<telerik:GridTableView Name="AccountDetails" runat="server" AllowPaging="false" PageSize="25"
ShowHeader="false" TableLayout="Auto" >
<HeaderStyle BackColor="#d1d1d1" />
<Columns>
--------------------
--------------------
</Columns>
</telerik:GridTableView>
</DetailTables>
</telerik:GridTableView>
</DetailTables>
</telerik:GridTableView>
</DetailTables>
</telerik:GridTableView>
</DetailTables>
</mastertableview>
<clientsettings allowexpandcollapse="false" />
</telerik:RadGrid>

Hi, I've a grid:
<telerik:RadGrid ID="Grid" runat="server" GridLines="None" AllowPaging="True" CssClass="RadGrid" AllowSorting="True" AutoGenerateColumns="false" ShowStatusBar="true" AllowFilteringByColumn="true"> <ValidationSettings EnableValidation="true" EnableModelValidation="true" CommandsToValidate="Insert,Edit,Update" /> <MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="Id" InsertItemPageIndexAction="ShowItemOnCurrentPage">And I am using EF as Datasource (with RepositoryPattern).
Furthermore I user Dataannotations - so every Entity has a partial MetadataClass with Annotations like:
[MetadataType(typeof(entityMetadata))] public partial class entity { internal sealed class entityMetadata { [Required(ErrorMessage="Id is required")] public Int32 Id { get; set; } [Required(ErrorMessage="Name is required")] [StringLength(400)] public String Name { get; set; } [Required(ErrorMessage="Description is required")] public String Description { get; set; } } }I thought with "EnableModelValidation" the Grid would automatically validate against this annotations.
But it doesn't.
My UpdateCommand looks like this:
void Grid_UpdateCommand(object sender, GridCommandEventArgs e)
{
using (IGenericRepository<Lov_KpiType> repositroy = new GenericRepository<Lov_KpiType>())
{
GridEditableItem item = e.Item as GridEditableItem;
int kpiType_Id = Convert.ToInt32(item.GetDataKeyValue("Id").ToString());
Lov_KpiType kpiType = repositroy.FindById(kpiType_Id);
item.UpdateValues(kpiType);
repositroy.SaveChanges(); }
}
The item is not updated and the Grid changes to TemplateMode again. No errormessage is show at this time..
I thought, as it is in MVC, when Data-Annotations are used - no Postback is done when ClientSideValidation fails.
Furthermore I do not know, how to determine if there is an validation-error in code behind.
Please help :)
