|
|
|
date: Fri, 4 Jul 2008 17:53:21 +0300,
group: microsoft.public.dotnet.framework.aspnet.buildingcontrols
back
Re: challenging dynamic reporting portal using webparts.
Hi Rifat,
DeclarativeCatalogZone has a property called "WebPartsTemplate" which has
the type of ITemplate.
So; the idea how to use it is just like below.
<asp:CatalogZone ID="mainCatalogZone" runat="Server">
<ZoneTemplate>
<asp:DeclarativeCatalogPart ID="mainCatalogPart" runat="server"
Title="Available WebParts">
</asp:DeclarativeCatalogPart>
</ZoneTemplate>
</asp:CatalogZone>
In code behind:
DeclarativeCatalogPart m_MainCatalogPart =
mainCatalogZone.FindControl("mainCatalogPart") as DeclarativeCatalogPart;
if (m_MainCatalogPart == null)
return;
WebPartsList m_WebPartsList = new WebPartsList();
m_MainCatalogPart.WebPartsTemplate = m_WebPartsList;
And "WebPartsList" class and its logic looks like the following:
public class WebPartsList : ITemplate
{
#region ITemplate Members
public void InstantiateIn(Control owner)
{
// Add WebParts here, in a foreach or a for or any other applicable circle
WebPart m_WebPart = new WebPart(); // You must set the correct type here
m_WebPart.ID = "wp123";
m_WebPart.Title = "Title";
m_WebPart.Description = "Description";
owner.Controls.Add(m_WebPart);
}
#endregion
}
--
All the best,
Coskun SUNALI
MVP ASP/ASP.NET
http://sunali.com
http://www.propeople.dk
"rifat yavuz" wrote in message
news:uknjzWe3IHA.5088@TK2MSFTNGP03.phx.gbl...
> hello,
> I am trying to create n controls, modify each controls' properties then
> add them to the catalog zone.
>
> Then the user will select and add each webpart to the approciate
> webpartzone.
>
> why n?
> each control is a different report the user has generated before and each
> query of them is saved in the database.
> the purpose of this is, when the user logs in, I will find the querries of
> the user, populate each report item (control) in the catalog zone,
> then the user will be able to select what report she wants to see in her
> welcome page....
>
> need a lot help on this (referral, sample, advice.....)
>
> rifat
>
>
date: Wed, 9 Jul 2008 14:34:16 +0300
author: Coskun SUNALI [MVP]
Re: challenging dynamic reporting portal using webparts.
Thanks for the idea,
I will try the idea
tsk :)
"Coskun SUNALI [MVP]" wrote in message
news:u1gr8eb4IHA.4908@TK2MSFTNGP04.phx.gbl...
> Hi Rifat,
>
> DeclarativeCatalogZone has a property called "WebPartsTemplate" which has
> the type of ITemplate.
>
> So; the idea how to use it is just like below.
>
>
>
> <asp:CatalogZone ID="mainCatalogZone" runat="Server">
> <ZoneTemplate>
> <asp:DeclarativeCatalogPart ID="mainCatalogPart" runat="server"
> Title="Available WebParts">
> </asp:DeclarativeCatalogPart>
> </ZoneTemplate>
> </asp:CatalogZone>
>
>
>
> In code behind:
>
>
>
> DeclarativeCatalogPart m_MainCatalogPart =
> mainCatalogZone.FindControl("mainCatalogPart") as DeclarativeCatalogPart;
>
> if (m_MainCatalogPart == null)
> return;
>
> WebPartsList m_WebPartsList = new WebPartsList();
>
> m_MainCatalogPart.WebPartsTemplate = m_WebPartsList;
>
>
>
> And "WebPartsList" class and its logic looks like the following:
>
>
>
> public class WebPartsList : ITemplate
> {
> #region ITemplate Members
>
> public void InstantiateIn(Control owner)
> {
> // Add WebParts here, in a foreach or a for or any other applicable circle
>
> WebPart m_WebPart = new WebPart(); // You must set the correct type here
>
> m_WebPart.ID = "wp123";
> m_WebPart.Title = "Title";
> m_WebPart.Description = "Description";
>
> owner.Controls.Add(m_WebPart);
> }
>
> #endregion
> }
>
> --
> All the best,
> Coskun SUNALI
> MVP ASP/ASP.NET
> http://sunali.com
> http://www.propeople.dk
>
> "rifat yavuz" wrote in message
> news:uknjzWe3IHA.5088@TK2MSFTNGP03.phx.gbl...
>> hello,
>> I am trying to create n controls, modify each controls' properties then
>> add them to the catalog zone.
>>
>> Then the user will select and add each webpart to the approciate
>> webpartzone.
>>
>> why n?
>> each control is a different report the user has generated before and each
>> query of them is saved in the database.
>> the purpose of this is, when the user logs in, I will find the querries
>> of the user, populate each report item (control) in the catalog zone,
>> then the user will be able to select what report she wants to see in her
>> welcome page....
>>
>> need a lot help on this (referral, sample, advice.....)
>>
>> rifat
>>
>>
date: Thu, 10 Jul 2008 11:04:53 +0300
author: rifat yavuz
|
|