Getting the ComboBox to show a blank value


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Since you are using the DevExpress controls, use the EditMask.  If you set the EditMask to ###, for example, and a MaskType of Numeric, it will by default hide any zero values.  You may decide to use the DisplayMask instead.  But you can do it through masking.
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
Great!  I got it working finally...I must have just been overlooking the Value Member in the Data Source Setting.  I was actually trying to set the DataSource to a table manually, but it worked much better after i created a BO and had it do the work for me.  I just have one other question along these same lines...

I have a textbox that is bound to an integer value. If I want it to show a blank unless there is a nonzero value how do I go about doing that?

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Andria,

One other thing, instead of setting the TopMost property in the load, use the property within the property sheet.  It will work much better since it will load it into the data source with the rest of the records.  Otherwise it may not work at all depending on the order of instantiation.


Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Andria,

In your DevExpress combo you have the Value Member set to the cust_pk which is integer.  But the TopMostItem's value is empty which would make it a string.  Thus the error you are getting.  The type of value member and the type of TopMostItem have to match.  If you set the Value Member in the PopulationDataSourceSettings to cust_lname which is the value I wanted to associate with the combo box, then it will work fine.

The value member in the PopulationDataSourceSetting is the value that gets assigned to a bound value.  So in your previous posts you mentioned that the bound value is a string field called RateCode.  So your value member should be RateCode.  If you are creating custom properties such as RateCode1, the this would be your value member. 

Let me know if this answers your question.

Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
Ok, that works for the SF combobox, but did I forget to mention that I was using a DevX Inherited Combo?  I have included the sample you did with an added DevX SF combo.  I set it up the same as the SF combo, but the topmost property doesn't work correctly.  I put the TopMostItem property setting in the Form Load event, because when I tried to set it at design time for the DevX control, it gave me an error.  Please see if you can figure anything out with these behaviors.  Thanks.
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Andria,

Attached is a simple example of a character based topmost item.  I am not using a bound field to simplify the example, but if you have a bound field it will work in the same fashion.  To see how the sample works, run the solution and the select a value other than the topmost item.  Once a valid customer name has been selected, click the button to force the SelectedValue back to the top most item.  The concept of a bound value is the same.  Instead of manually setting the SelectedValue, the binding will set it for you when the bound record is navigated to a value that matches the top most value.

Let me know if you have any questions. Smile

Attachments
SampleTopMostItem.zip (120 views, 732.00 KB)
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
That's okay...I know what you mean.  I've got lots to do myself which is the only reason this is important to me at the moment. Wow  Thanks for the help!
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Andria,

Sorry I haven't gotten back with you.  I have been overrun this week.  I will look at this in the morning and get something to you. Blush

Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
Has anything been figured out with this issue? 
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
Thanks for the help Trent, I look forward to hearing from you!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search