473,387 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Collapsible Nested Datalists ? Findcontrol by Value?

I have two Nested repeating Datalists with different data sources.

Currently the second Datalist is set to visible=false

I have an oncommand button on the first, that when selected I would
like to make it's sub datalist visible.

I'm a bit confused about how to refrence the instance of the second
datalist.

Below is the command from the first .

The Master Datalist is called datalista, the Sub is called Datalist1.

Sub View(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.CommandEventArgs)

CType(Datalist1.FindControl("Datalist1")), DataList).Visible =
True

End Sub

The above code is giving an error that I'm "not set to an instance of
an object"

e.CommandArgument conntains a value which could be used to identify
items inside Datalist1, I'm just wondering, how do I identify the
control itself it it no databound identifiers? and can I even have
specific instances as visible = true ???

Oct 16 '06 #1
2 2042
try this

datalist2=new datatlist(e.command)
datatlist2.visible=true;

"jobs" wrote:
I have two Nested repeating Datalists with different data sources.

Currently the second Datalist is set to visible=false

I have an oncommand button on the first, that when selected I would
like to make it's sub datalist visible.

I'm a bit confused about how to refrence the instance of the second
datalist.

Below is the command from the first .

The Master Datalist is called datalista, the Sub is called Datalist1.

Sub View(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.CommandEventArgs)

CType(Datalist1.FindControl("Datalist1")), DataList).Visible =
True

End Sub

The above code is giving an error that I'm "not set to an instance of
an object"

e.CommandArgument conntains a value which could be used to identify
items inside Datalist1, I'm just wondering, how do I identify the
control itself it it no databound identifiers? and can I even have
specific instances as visible = true ???

Oct 16 '06 #2
I have only tried it with GridViews and DataGrids -- but, you must find and
define it first - then, set it's properties. I haven't tried this, but it
should at least get you going the correct direction.
It should be more like:
Dim sList as DataList
sList = CType(MainDL.FindControl("Datalist1")), DataList)
sList.Visible = True

The other thing to look at is 'where' you're trying this - -
are you saying you have a button, that will be clicked to make the one in
that row visible?

David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com

"jobs" <jo**@webdos.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.com...
I have two Nested repeating Datalists with different data sources.

Currently the second Datalist is set to visible=false

I have an oncommand button on the first, that when selected I would
like to make it's sub datalist visible.

I'm a bit confused about how to refrence the instance of the second
datalist.

Below is the command from the first .

The Master Datalist is called datalista, the Sub is called Datalist1.

Sub View(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.CommandEventArgs)

CType(Datalist1.FindControl("Datalist1")), DataList).Visible =
True

End Sub

The above code is giving an error that I'm "not set to an instance of
an object"

e.CommandArgument conntains a value which could be used to identify
items inside Datalist1, I'm just wondering, how do I identify the
control itself it it no databound identifiers? and can I even have
specific instances as visible = true ???

Oct 16 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: R Reyes | last post by:
Hi. I'm trying to make some event handlers for buttons that are nested within datalists, however I keep getting errors trying to access them and a blank page shows w/o any real error message. How...
4
by: V. Jenks | last post by:
What seems like a simple thing is apparently not so straightforward? I have a datalist. Inside of that datalist is an <itemtemplate> secion which contains other server controls such as a...
2
by: Greg Fischer | last post by:
I need to access the properties of a control that is nested in 2 datalists. How do you use findcontrol method to do that? what I have is like this: <asp:datalist id="dlist" runat="server">...
0
by: Marty U. | last post by:
I have two datalists nested. On the ItemDataBound Event of the first datalist I databind the second with specific info. A couple questions: 1) How can I utilize the OnItemCommand of the nested...
1
by: D. Shane Fowlkes | last post by:
Hey guys....I tried Googling and search these forums before posting but couldn't find really what I was looking for. I'm looking for a very simple example or tutorial on how to nest Repeaters in...
2
by: scottls | last post by:
Hi All, Thanks for reading my post. I have been working on getting nested datalists working properly wihtin my framework for many days and I think I'm almost there. See if you could help me...
2
by: Ole V.-M. | last post by:
Greetings, i have a UserControl, that contains a DataList. That DataList contains as items other DataLists. example: DataList A Row 1 Nested DataList 1 Row 1
0
by: sharonrao123 | last post by:
hello all, I have a parent gridview company and in this one a nested gridview people, Is it possible to allow the user to select one row or multiple rows from the people gridview using a check box...
5
by: John Kotuby | last post by:
Hi all, After more than a year programming with ASP.NET 2.0 and VB I am still finding it difficult to leave some habits from classic ASP behind. this is particularly true with cross-page posting....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.