如何在组合框中显示数字 [英] how to show numbers in combobox

查看:94
本文介绍了如何在组合框中显示数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在制作一个vb.net Windows应用程序.

我有两个组合框,一个是预留席位,另一个是可用席位.

现在,在预留席位组合框中,值来自数据库(最大席位为50).

假设保留了5号和8号席位,那么我希望在组合框2中显示5号和8号席位以外的其余席位

我怎样才能做到这一点?

请帮忙.
在此先感谢

Hello to all,

I am making a vb.net windows application.

I have two comboboxes, one is of reserved seats and another of available seats.

Now in reserved seat combobox the values are coming from database (maximum seats are 50).

Suppose seats no.5 and 8 are reserved then I want that the remaining seats except 5 and 8 should show available in combobox2

How can I make this happen?

Please help.
Thanks in advance

推荐答案

您将为此编写一些逻辑.
只需从列表中删除作为组合源的数字即可.

您可以尝试使用combobox1.items.removeAt(position).
You will have to write some logic for this.
Just remove the numbers that exist from the list that acts as the source for your combo.

You could try using combobox1.items.removeAt(position).


正如您所说的那样,数据来自数据库...为什么不在数据库级别实现logix并绑定按返回的数据显示组合框?
As you have said the the data is coming from the Database...why don''t you implement the logix at the database level and bind the combobox as per the returned data?


我认为您需要创建自己的逻辑.

在每个PostBack上,我认为您都需要从数据库中重新填充List.这对于ASP.NET是必不可少的,因为可能会有其他人预订每次都需要删除的座位.
I think you need to create your own logic.

On every PostBack, I think you need to repopulate the List from the database. This is essential for ASP.NET as there might be someone else to book seats which you need to remove every time.


这篇关于如何在组合框中显示数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆