Answered by:
Populating listbox based on another listbox in Propertygrid

Question
-
HI,
Could any one please tell how to populate the values on one listbox based on the other dynamically in PropertyGrid. I am not able to get the control of the second listbox until it is explicitly selected in the property grid.
Eg:
ListBox1:
USA
India
ListBox:
If in listbox 1, USA is selected then it listbox the values should be populated as
mexico
memphsis
at the runtime without user clicking on the listbox2.
else atleast the values in ListBox should be none, so that when the user clicks on listbox2, proper values are populated.
Thanks,
Sudhi- Moved by Zhi-Xin Ye Wednesday, September 24, 2008 10:47 AM off topic (Moved from .NET Base Class Library to Off-Topic Posts (Do Not Post Here))
Thursday, September 18, 2008 9:43 AM
Answers
-
Hello Sudi,
Thank you for your post! I would suggest posting your question in one of the
located here: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/threads/.
Have a great day!
- Proposed as answer by Shrikant Maske Friday, October 24, 2008 8:48 AM
- Marked as answer by Sudarshan Belur Monday, November 3, 2008 11:16 AM
Friday, October 24, 2008 8:48 AM
All replies
-
You can do anything like this with reflection as a last resort (only because it's a bit slower)...
http://www.codeproject.com/KB/vista/GetControlProperties.aspx
If you know the other form name... you just iterate through the controls..
http://www.google.com/search?hl=en&q=all+controls+on+a+form&aq=f&oq=
Or if you have a pointer to the form say form2 and know the control's name it's just like anything else.
form2.controlname2.property2..
JavamanThursday, September 18, 2008 10:45 AM -
HI Javaman,
Thanks for the quick reply. I am using C# and moreover the listbox in propertygrid is getting populated based on the click of the down-arrow in the propertygrid.
Thanks,
SudhiThursday, September 18, 2008 10:58 AM -
Hello Sudi,
Thank you for your post! I would suggest posting your question in one of the
located here: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/threads/.
Have a great day!
- Proposed as answer by Shrikant Maske Friday, October 24, 2008 8:48 AM
- Marked as answer by Sudarshan Belur Monday, November 3, 2008 11:16 AM
Friday, October 24, 2008 8:48 AM