Print Page | Close Window

FindControl only finds first instance?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=20590
Printed Date: 28 September 2024 at 10:26pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: FindControl only finds first instance?
Posted By: iandavo
Subject: FindControl only finds first instance?
Date Posted: 04 February 2013 at 4:41pm
<Edit 14/2>
Never mind, Seeing as how nobody replied with a suggestion I hunted around further & eventually found the article innocuously titled "Using CommandBar Actions" here: http://codejock.com/support/articles/com/commandbars/cb_26.asp. How I wish the help file was as clear as this article... and how I wish I'd found it before I spent hours trying to figure it all out from the sample projects AngryWithin 3 minutes of reading this article I had it all working great.
</Edit 14/2>

I'm just learning how to use CommandBars in an application. I have implemented a Visual Theme menu button and a toolbar split button popup in a similar way to that done in a couple of the tutorials, but I've centralised the code to place a check mark against the current theme. When using the FindControl method to find the correct item to check I'm finding that it only returns one instance of the control, so only the item in the popup list from the toolbar is checked. I've tried to iteratively call FindControl but can't get that to work (what I'd really like is a FindNextControl method!). I'm now thinking I'll have to use different ID's for the 2 controls, but I don't like that idea because it's then less generic or portable to another application. Does anyone have any ideas?

Thanks & regards

Ian




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net