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

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:



 (will not be displayed)


 
 
 
 
 

Live Comment Preview:

 
«November»
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345