Add SelectedValue property to MetaBuilders' ComboBox

 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

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted @ Thursday, September 08, 2005 11:00 AM
Print

Comments on this entry:

# re: Add SelectedValue property to MetaBuilders' ComboBox

Left by Michael at 7/17/2006 3:05 PM
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

Your comment:



(not displayed)


 
 
 
 
 

Live Comment Preview:

 
«February»
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910