Click here to Skip to main content
16,019,614 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

How i can get access to controls inside the 2nd datalist before the 1st datalist is not bind to any dataset?

datalist1
itemtemplate
controls
datalist2
itemtemplate
controls
/itemtemplate
/datalist2
/itemtemplate
/datalist1

I am using datalist inside another datalist. i want access to controls of datalist2 before the datalist1 is bind with some data.

I have used
label txtcount=(label)datalist2.items[i].findcontrol("lblcountval");

But error is index can't be nonzero or more than items in container

label txtcount=(label)datalist2.findcontrol("lblcountval");

This gives error object reference can't be set to instance of object..

please suggest something..

Thanks in Advance.
Posted
Updated 9-Jun-11 1:31am
v2

Hope this[^] also might help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900