bandzuch martin
2/20/2004 7:54:00 AM
thank you very much for taking that test.
at least i know that the problem is somewhere in my aspx code, because some
things
i had changed manually. i better recreate the page again.
have a nice day and thank you again.
"Alessandro Zifiglio" <alessandrozifiglio@NO-SPAM-hotmail.com> wrote in
message news:J46Zb.9205$HO2.5115@news.edisontel.com...
> Ok, just tested and i were under the impression that the multipage control
> behaved like the datalist, datagrid and repeater controls in that they
> supplied their own naming scheme to child controls but this is not so.
> Please ignore my earlier post ;P
>
> I have just run a small test and I've been able to bind a datalist
> successfully, within a multipage control that is, so the problem remains
> within your custom control. You've also stated that this has worked nicely
> when not contained within the multipage control. At this point i have no
> idea why it is not working for you ;P
>
> "mato" <mbandzuch@gratex.com> wrote in message
> news:uY7XSKw9DHA.2856@TK2MSFTNGP10.phx.gbl...
> > hello alessandro.
> > thank you for your interest.
> > my problem is not that i can not get reference to datalist. the problem
is
> > in binding.
> > let me explain, how i create this control hierarchy ( every step is in
> > design time ):
> > 1. i put multipage control from toolbar at design time.
> > 2. then i add 2 pages.
> > 3. on first page i add my first custom control ( CategoryTreeView )
> > 4. on second page i add asp net dataList control
> > 5. on page i add my second custom control ( PropertyGroupDataList )
> > 6. then i create some dataBinding to 2 properties on
> > PropertyGroupDataList ( PropertySessionId and PropertyGroupName )
> > 7. then i start template editing of items on dataList control
> > 8. add my custom PropertyGroupDataList with dataBindings to item
> > template
> > 9. stop template editig
> >
> > now i added some behind code. like createDataView ( create table, add
two
> > columns, then add some rows with values set ).
> > then do DataBind() on dataList. The problem is that if i put this
dataList
> > under PageView it does not bind to PropertySessionId and
PropertyGroupName
> > properties. when it is placed on the page ( the same control, the same
> > bindings ) it works fine.
> >
> > but maybe i misunderstand what you wrote.
> >
> > "Alessandro Zifiglio" <alessandrozifiglio@NO-SPAM-hotmail.com> wrote in
> > message news:1S4Zb.9181$HO2.1778@news.edisontel.com...
> > > hi mato, the reason you are unable to bind to the datalist when it is
a
> > > child control is because you "It is a childcontrol to pageview, either
> you
> > > get a reference to your datalist through page view using the
fincontrol
> > > method or just simply add your datalist to a usercontrol and do the
> > binding
> > > in your usercontrols code behind. And then add your usercontrol as a
> > > childcontrol to pageview. This way you get direct access to your
> datalist
> > > from the usercontrols codebehind directly. Also simplifies a lot of
> things
> > > for you.
> > >
> > > "mato" <mbandzuch@gratex.com> wrote in message
> > > news:usUddyv9DHA.1392@tk2msftngp13.phx.gbl...
> > > > hello!
> > > > i have this problem. i put datalist control under pageview, and the
> same
> > > > datalist on the page.
> > > > when it is placed under pageview, it does not bind, on the page
works
> > > fine.
> > > >
> > > > this is piece of my aspx code.
> > > >
> > > > ....
> > > > <iewc:Multipage id="someId" runat="server" ... >
> > > > <iewc:PageView id="page1">
> > > > <cc1:CategoryTreeView id="categoryTree" runat="server" >
> > > > </cc1:CategoryTreeView>
> > > > </iewc:PageView>
> > > > <iewc:PageView id="page2">
> > > > <asp:DataList id="data1" runat="server" >
> > > > <ItemTemplate>
> > > > <cc1:PropertyGroupDataList id="propertyGroup1"
> > > > runat="server" PropertySessionId='<%#
> > > > DataBinder.Eval(Container.DataItem,"propertySessionId") %>'
> > > Expanded="true"
> > > > PropertyGroupName='<%#
> > > > DataBinder.Eval(Container.DataItem,"propertyGroupName") %>' >
> > > > </cc1:PropertyGroupDataList>
> > > > </ItemTeplate>
> > > > </asp:DataList>
> > > > </iewc:PageView>
> > > >
> > > > <asp:DataList id="data2" runat="server" >
> > > > <ItemTemplate>
> > > > <cc1:PropertyGroupDataList id="propertyGroup2"
> > > > runat="server" PropertySessionId='<%#
> > > > DataBinder.Eval(Container.DataItem,"propertySessionId") %>'
> > > Expanded="true"
> > > > PropertyGroupName='<%#
> > > > DataBinder.Eval(Container.DataItem,"propertyGroupName") %>' >
> > > > </cc1:PropertyGroupDataList>
> > > > </ItemTeplate>
> > > > </asp:DataList>
> > > >
> > > > ......
> > > >
> > > >
> > > > c# page behind code.
> > > > public class MyWebPage : System.Web.UI.Page
> > > > {
> > > > ....
> > > > private void MyWebPage_PageLoad(object sender, System.EventArgs
e)
> > > > {
> > > > BindDataList();
> > > > }
> > > >
> > > > private void BindDataList()
> > > > {
> > > > System.Data.DataView _view = CreateDataSource();
> > > > data1.DataSource = _view;
> > > > data1.DataBind();
> > > >
> > > > data2.DataSource = _view;
> > > > data2.DataBind();
> > > > }
> > > > ....
> > > > }
> > > >
> > > > c# custom control code:
> > > > public class PropertyGroupName : System.Web.UI.WebControls.DataList
> > > > {
> > > > ....
> > > >
> > > > [ System.ComponentModel.Bindable( true ) ]
> > > > public PropertySessionId
> > > > {
> > > > get
> > > > {
> > > > ...
> > > > }
> > > > set
> > > > {
> > > > ...
> > > > }
> > > > }
> > > >
> > > > [ System.ComponentModel.Bindable( true ) ]
> > > > public PropertyGroupName
> > > > {
> > > > get
> > > > {
> > > > ...
> > > > }
> > > > set
> > > > {
> > > > ...
> > > > }
> > > > }
> > > > ....
> > > > }
> > > >
> > > >
> > > > thank you for any comment, suggestion, help, opinion, anything
> > > >
> > > >
> > >
> > >
> >
> >
>
>