打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
CCSElite
Posted: 02/24/2009 11:38 AM

Hi

Listboxes and Radio Buttons are pretty neat components to have available in the CodeCharge Studio Framework. These two components are very similar on the design side so this one description should cover both.

Start by creating either a listbox or radio button control on you record form (Or convert an existing control to listbox or radio button).

After having done this you will notice in the properties a connection, Data Source Type, Data Source. Set connection to the database connectin you want to use. Set Type to Table/View, and Source to the table you want your listbox or radio button control to use for the next two properties.

The bound colomn property represents the data field in the table that the component will use to fill the field on you form when the corresponding text colomn is selected.

The text colomn is the text that will display on your page for that particular value.

EG:
Bound colomn = 1,2,3
Text colomn = one,two,three
respectively.

Your listbox or radio button component will display on the screen for possible values one two three

When a selection is made the correspondin bound colomn value will be placed into the form field and be entered into your database field specified for that control.

EG: with the above values if ONE is selected the value 1 will be applied to that form field and entered into the database field scpeified for that control at design time.

Next issue is to be able to display the database saved value for that control on another page.

If on all pages in your application that field is represented by the same type contol (ie. listbox or radio button) The control will display just as if it had been selected by a user with the data saved in your database.

However, Listboxes and Radio buttons are only really practical for input fields. If you are only wanting to display the values stored in the database in a regular text field you will need to make some cosiderations.

One method and probably the easiest is to create the bound colomn and text colomn with the same text data. This way the value entered into the database is the same as the text value and when the Database field is displayed in a text field, it will show the text in the control.

If your application requires that the bound data must be different from the text data, you will have to do something different.

The way to do this would be in the text field that is to display the stored listbox or radio button and you want the text to display use a DLookup action in the before show event for the control.

Your Dlookup action should perform a lookup for the container value of the control in the bound colomn and return tghe value of the text colomn. This will cause the text field to display the text value stored in the database for that data on your form.

Hope that helps

Have fun

Joh
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Communication on a serial port in NET 2.0
PowerBuilder Online Training Courses
线程间操作无效: 从不是创建控件“listBox”的线程访问它
VB表格控件总览与例程分析
listbox控件的一些操作
关于ilist泛类的用法 - .NET技术 / ASP.NET
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服