Geeks With Blogs

News My Blog has been MOVED to https://mfreidge.wordpress.com

Michael Freidgeim's OLD Blog My Blog has been MOVED to https://mfreidge.wordpress.com

 I am using  MetaBuilders.ComboBox[^] and recently found that I am not able to specify SelectedValue in Page_OnLoad event.

The html list has “selected“ as expected , but text box is not populated with selected value.

It is required to add SelectedValue  to the MetaBuilders.WebControls.ComboBox.

            ///

            /// Overrides .

            /// Should be overridden to addition to SelectedIndex

            ///

            public override string SelectedValue

            {

                  get

                  {

                        return base.SelectedValue;

                  }

                  set

                  {

                        base.SelectedValue = value;

                        // this.isLoaded is used in  SelectedIndex to ensure special 

                    //processing  when called from LoadPostData

                        // not required in SelectedValue property

                        this.Text = SelectedValue;

                  }

            }

You need to download MetaBuilders.ComboBox[^] from http://www.metabuilders.com/Tools/ComboBox.aspx

and add the SelectedValue code to the MetaBuilders.WebControls.ComboBox class in ComboBox.cs file.

Then compile the project and use DLL in the same way as original MetaBuilders combo-box can be used.

See here another fix for MetaBuilders.WebControls.ComboBox, which is important if you use SmartNavigation

Posted on Thursday, September 8, 2005 11:00 AM ASP.NET | Back to top


Comments on this post: Add SelectedValue property to MetaBuilders' ComboBox

# re: Add SelectedValue property to MetaBuilders' ComboBox
Requesting Gravatar...
Hi

I have tried adding the code..what happens when I try set the selectedvalue...it seems to set the value in the list but the textbox remains blank...any ideas?

Micahel
Left by Michael on Jul 17, 2006 3:05 PM

Your comment:
 (will show your gravatar)


Copyright © Michael Freidgeim | Powered by: GeeksWithBlogs.net