Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > How to use query repeater as nested repeater, more repeaters in one transformation View modes: 
User avatar
Member
Member
o.gavron-appril - 8/9/2010 2:47:04 AM
   
How to use query repeater as nested repeater, more repeaters in one transformation
Hello,

I have a problem. I want to place more nested queryrepeaters in the same ascx transformation.

It will return error CS0111

Here is code:



<table>
<tr><td><b>StavbaID</b></td><td><%# Eval("StavbaID")%></td></tr>
<tr><td><b>Stavba</b></td><td><%# Eval("Stavba")%></td></tr>
<tr><td><b>Ulica</b></td><td><%# Eval("Ulica")%></td></tr>

<cms:queryrepeater StopProcessing="false" runat="server" ID="qrObce" QueryName="customtable.Obce.selectall" TransformationName="customtable.Obce.List"/>

<script runat="server">
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
if (this.Parent is IDataItemContainer)
{
IDataItemContainer cont = this.Parent as IDataItemContainer;
if (cont != null)
{
System.Data.DataRowView drv = (System.Data.DataRowView)cont.DataItem as System.Data.DataRowView;
if (drv != null)
{
string ObecID = ValidationHelper.GetString(drv["ObecId"], "");
if (ObecID != "")
{
qrObce.WhereCondition= "ItemId= " + ObecID;
qrObce.ReloadData(true);
}
}
else
{
Response.Write("Error: DataRowView is null");
}
}
else
{
Response.Write("Error: IDataItemContainer is null");
}
}
}
</script>

<cms:queryrepeater StopProcessing="false" runat="server" ID="qrKategorie" QueryName="customtable.StKategoria.selectall" TransformationName="customtable.StKategoria.List"/>

<script runat="server">
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
if (this.Parent is IDataItemContainer)
{
IDataItemContainer cont = this.Parent as IDataItemContainer;
if (cont != null)
{
System.Data.DataRowView drv = (System.Data.DataRowView)cont.DataItem as System.Data.DataRowView;
if (drv != null)
{
string KategoriaID = ValidationHelper.GetString(drv["KategoriaID"], "");
if (KategoriaID != "")
{
qrKategorie.WhereCondition= "ItemId= " + KategoriaID;
qrKategorie.ReloadData(true);
}
}
else
{
Response.Write("Error: DataRowView is null");
}
}
else
{
Response.Write("Error: IDataItemContainer is null");
}
}
}
</script>


</table>


Cen you help me, how to write correct code?

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 8/9/2010 3:44:01 AM
   
RE:How to use query repeater as nested repeater, more repeaters in one transformation
Hi,
could you please check following article about nested query repeater?
http://devnet.kentico.com/Knowledge-Base/Web-parts---Controls/How-to-use-query-repeater-as-nested-repeater.aspx

Best regards,
Ivana Tomanickova

User avatar
Member
Member
o.gavron-appril - 8/9/2010 3:53:39 AM
   
RE:How to use query repeater as nested repeater, more repeaters in one transformation
Thanks for your answer,

But there is no solution of my problem in this article. My problem is CS0111. I have read an article some days ago.

Thank you

have a nice day

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 8/9/2010 4:46:22 AM
   
RE:How to use query repeater as nested repeater, more repeaters in one transformation
Hi

Your CS0111 error is a compiler error described here:
http://msdn.microsoft.com/en-us/library/ddza5cw4%28VS.80%29.aspx

In your code is following method defined twice:
protected override void OnInit(EventArgs e)

That is probably reason of your CS0111 error. To be sure, could you please search for this error in Google or sent us the whole error message?

Best regards,
Ivana Tomanickova

User avatar
Member
Member
o.gavron-appril - 8/9/2010 12:30:19 PM
   
RE:How to use query repeater as nested repeater, more repeaters in one transformation


Thanks,I have solved a problem, I succeed to place more nested repeaters using one method.

The method was defined twice... :-)

Thanks

Otto