473,857 Members | 1,870 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

the real value of the combo box

Tan
Hello Everyone
Need help!

I have a object with the integer property that represent the address type. I
like to show a combo box in the grid linked to an object data source
displaying the string value instead of integer value.

any help would very much appriciated

Tan
Nov 19 '05 #1
6 1352
???

Very little to go on here but ok.. please add code to these kind of
questions.

If you are infact binding the DropDownbox from a datasource.. then just set
the DateValueField to the name of that field in the datasource.

But since you are using the word "ComboBox". . are you using ASP or Windows
Forms (This is the ASP.NET forum you know... so the question might be in
the wrong place)?

/Lars

"Tan @hotmail.com>" <tannguyen88<no spam> wrote in message
news:uA******** ******@TK2MSFTN GP09.phx.gbl...
Hello Everyone
Need help!

I have a object with the integer property that represent the address type.
I like to show a combo box in the grid linked to an object data source
displaying the string value instead of integer value.

any help would very much appriciated

Tan

Nov 19 '05 #2
Tan
I am developing a asp.net program and I want to display a dropdown box in
the details view linked to object data source

But I do not know how to display a dropdown box in thie Details view showing
the string value instead of integer

thank a lot

Tan

"Lars Netzel" <ui****@adf.s e> wrote in message
news:eZ******** *****@TK2MSFTNG P09.phx.gbl...
???

Very little to go on here but ok.. please add code to these kind of
questions.

If you are infact binding the DropDownbox from a datasource.. then just
set the DateValueField to the name of that field in the datasource.

But since you are using the word "ComboBox". . are you using ASP or Windows
Forms (This is the ASP.NET forum you know... so the question might be in
the wrong place)?

/Lars

"Tan @hotmail.com>" <tannguyen88<no spam> wrote in message
news:uA******** ******@TK2MSFTN GP09.phx.gbl...
Hello Everyone
Need help!

I have a object with the integer property that represent the address
type. I like to show a combo box in the grid linked to an object data
source displaying the string value instead of integer value.

any help would very much appriciated

Tan


Nov 19 '05 #3
Okay, so you have a DropDownBox in a Column of a DataGrid then?

A DropDown box is always a DropDownBox with all the same Properties and
Methods.
If it is in a DataGrid the only thing that differes is that its named
dynamically and you will have to add some more code to access the right
DropDownBox just... A Good place to access the right box is in the
DataItemBound event of the DataGrid.

But you still have the DataTextField and the DataValueField to use ...

If it seems like I'm not really getting what you are asking then please
provide more detailed information abtou this.

Best Regards/
Lars Netzel

"Tan @hotmail.com>" <tannguyen88<no spam> wrote in message
news:uX******** ******@TK2MSFTN GP12.phx.gbl...
I am developing a asp.net program and I want to display a dropdown box in
the details view linked to object data source

But I do not know how to display a dropdown box in thie Details view
showing the string value instead of integer

thank a lot

Tan

"Lars Netzel" <ui****@adf.s e> wrote in message
news:eZ******** *****@TK2MSFTNG P09.phx.gbl...
???

Very little to go on here but ok.. please add code to these kind of
questions.

If you are infact binding the DropDownbox from a datasource.. then just
set the DateValueField to the name of that field in the datasource.

But since you are using the word "ComboBox". . are you using ASP or
Windows Forms (This is the ASP.NET forum you know... so the question
might be in the wrong place)?

/Lars

"Tan @hotmail.com>" <tannguyen88<no spam> wrote in message
news:uA******** ******@TK2MSFTN GP09.phx.gbl...
Hello Everyone
Need help!

I have a object with the integer property that represent the address
type. I like to show a combo box in the grid linked to an object data
source displaying the string value instead of integer value.

any help would very much appriciated

Tan



Nov 19 '05 #4
Hi Tan,

A dropdown box holds a list of "ListItem" objects... each listitem object
has a piece of text that it shows,
and a piece that is its corresponding "value" so you're adding the text and
value to the listitem object,
then adding it to the dropdown box.

In a loop, you can do the following:

DropDownList1.I tems.Add(New ListItem(yourob ject.textvalue,
yourobject.inte gervalue))
for each object's text and corresponding value

HTH

Mona[Grapecity]
"Tan @hotmail.com>" <tannguyen88<no spam> wrote in message
news:uA******** ******@TK2MSFTN GP09.phx.gbl...
Hello Everyone
Need help!

I have a object with the integer property that represent the address type.
I like to show a combo box in the grid linked to an object data source
displaying the string value instead of integer value.

any help would very much appriciated

Tan

Nov 19 '05 #5
I think I've understood he need to use a template column with a DropDownBox,
but I dont' how to link the ddb with the field so I let you suggest ;).
Bye, Diego

"Lars Netzel" <ui****@adf.s e> wrote in message
news:uw******** ******@TK2MSFTN GP12.phx.gbl...
Okay, so you have a DropDownBox in a Column of a DataGrid then?

A DropDown box is always a DropDownBox with all the same Properties and
Methods.
If it is in a DataGrid the only thing that differes is that its named
dynamically and you will have to add some more code to access the right
DropDownBox just... A Good place to access the right box is in the
DataItemBound event of the DataGrid.

But you still have the DataTextField and the DataValueField to use ...

If it seems like I'm not really getting what you are asking then please
provide more detailed information abtou this.

Best Regards/
Lars Netzel

"Tan @hotmail.com>" <tannguyen88<no spam> wrote in message
news:uX******** ******@TK2MSFTN GP12.phx.gbl...
I am developing a asp.net program and I want to display a dropdown box in
the details view linked to object data source

But I do not know how to display a dropdown box in thie Details view
showing the string value instead of integer

thank a lot

Tan

"Lars Netzel" <ui****@adf.s e> wrote in message
news:eZ******** *****@TK2MSFTNG P09.phx.gbl...
???

Very little to go on here but ok.. please add code to these kind of
questions.

If you are infact binding the DropDownbox from a datasource.. then just
set the DateValueField to the name of that field in the datasource.

But since you are using the word "ComboBox". . are you using ASP or
Windows Forms (This is the ASP.NET forum you know... so the question
might be in the wrong place)?

/Lars

"Tan @hotmail.com>" <tannguyen88<no spam> wrote in message
news:uA******** ******@TK2MSFTN GP09.phx.gbl...
Hello Everyone
Need help!

I have a object with the integer property that represent the address
type. I like to show a combo box in the grid linked to an object data
source displaying the string value instead of integer value.

any help would very much appriciated

Tan



Nov 19 '05 #6
Well since controls within a datagrid do not exists until runtime you will
have to access and set the datasource in runtime in the right even and the
right event here would be "ItemDataBo und" of the Datagrid. here's an
example:

Private Sub DataGrid1_ItemD ataBound(ByVal sender As Object, ByVal e As
System.Web.UI.W ebControls.Data GridItemEventAr gs) Handles
DataGrid1.ItemD ataBound

'Get a referense to the object

Dim drpMyDropList As DropDownList =
CType(e.Item.Fi ndControl("Drop DownList1"), DropDownList)

'Set the right things to be able to bind

drpMyDropList.D ataTextField = "..."

drpMyDropList.D ataValueField = "..."

drpMyDropList.D ataSource = 'some object

drpMyDropList.D ataBind()

End Sub

Best Regards/

Lars Netzel



"Diego" <t> wrote in message news:Ox******** ******@TK2MSFTN GP15.phx.gbl...
I think I've understood he need to use a template column with a
DropDownBox, but I dont' how to link the ddb with the field so I let you
suggest ;).
Bye, Diego

"Lars Netzel" <ui****@adf.s e> wrote in message
news:uw******** ******@TK2MSFTN GP12.phx.gbl...
Okay, so you have a DropDownBox in a Column of a DataGrid then?

A DropDown box is always a DropDownBox with all the same Properties and
Methods.
If it is in a DataGrid the only thing that differes is that its named
dynamically and you will have to add some more code to access the right
DropDownBox just... A Good place to access the right box is in the
DataItemBound event of the DataGrid.

But you still have the DataTextField and the DataValueField to use ...

If it seems like I'm not really getting what you are asking then please
provide more detailed information abtou this.

Best Regards/
Lars Netzel

"Tan @hotmail.com>" <tannguyen88<no spam> wrote in message
news:uX******** ******@TK2MSFTN GP12.phx.gbl...
I am developing a asp.net program and I want to display a dropdown box
in the details view linked to object data source

But I do not know how to display a dropdown box in thie Details view
showing the string value instead of integer

thank a lot

Tan

"Lars Netzel" <ui****@adf.s e> wrote in message
news:eZ******** *****@TK2MSFTNG P09.phx.gbl...
???

Very little to go on here but ok.. please add code to these kind of
questions.

If you are infact binding the DropDownbox from a datasource.. then just
set the DateValueField to the name of that field in the datasource.

But since you are using the word "ComboBox". . are you using ASP or
Windows Forms (This is the ASP.NET forum you know... so the question
might be in the wrong place)?

/Lars

"Tan @hotmail.com>" <tannguyen88<no spam> wrote in message
news:uA******** ******@TK2MSFTN GP09.phx.gbl...
> Hello Everyone
> Need help!
>
> I have a object with the integer property that represent the address
> type. I like to show a combo box in the grid linked to an object data
> source displaying the string value instead of integer value.
>
> any help would very much appriciated
>
> Tan
>



Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1161
by: middletree | last post by:
Some posters here have occasionally used the term combo to refer to <select> form elements. If you have any VB background, you know that a true combo box is a dropdown with prefilled values, but which also allows the user to type in a value if it doesn't already exist in the dropdown. Well, somebody has made such a thing for the web. Go to http://iakt.rdsnet.ro/demo/widgetsDemo/ and check out the first thing listed, the Editable...
2
8243
by: Terry Bickle | last post by:
Please forgive me for using the wrong term here or there. I'm an old Excel 4 macro guy who didn't convert to VB and I'm tinkering with an Access 2000 DB. I'm sure there is a simple Access 101 answer for this. I have a subform which the user selects an item description from a combo box from a table. I want to obtain the cost for the item (another field in the table) also. I've been able to produce the second data field by rewriting the...
8
18408
by: Lyn | last post by:
Hi, Can anyone tell me how the initial value displayed in Combo Box is determined when a form is opened? I am loading the dropdown from one field ("CategoryName") of a table, with "ORDER BY ". The values in the dropdown are loaded in the correct order, but the initial value is not the first row of the dropdown as I expected. The field "CategoryName" is not the primary key for the table -- the PK is
1
11846
by: meganrobertson22 | last post by:
Hi Everyone- I am trying to use a simple macro to set the value of a combo box on a form, and I can't get it to work. I have a macro with 2 actions: OpenForm and SetValue. I can open my form, but I can't get the macro to set the value of a combo box on the form that opens. I don't need the macro to look up any values, I just want it to set the value of a combo box.
8
12123
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the combobox. What is the solution? Thank you in advance.
20
3733
by: MLH | last post by:
120 MyString = "How many copies of each letter do you need?" 150 MyVariant = InputBox(MyString, "How Many?", "3") If MyVariant = "2" Then MsgBox "MyVariant equals the string '2'" If MyVariant = 2 Then MsgBox "MyVariant also equals the value 2" 160 If MyVariant = "" Then HowManyCopies = 1 170 If Not IsNumeric(MyVariant) Then HowManyCopies = 1 MsgBox "OK. HowManyCopies has a value of " & CStr(HowManyCopies) 180 For i =...
4
2352
by: Torilyn73 | last post by:
I have a combo box set up off a query. I want the default value to be the column heading so I don't have to put a label over it. So far I haven't been able to figure this out. Can anyone tell me if this is possible... and if so..how? Thanks!
9
2349
by: oriondcv | last post by:
hi, please help me on this issue that im facing... I have created a filtered combo box in ms access. It works but the value it inputs in the database is the primary key value like in my program (lngMyID =1) . What i would like to have is the value that 1 represents username. here is my source code Private Sub cboStore_AfterUpdate() Dim sManagerSource As String Dim sFunctional As String Dim sFunctionMade As Variant
0
9923
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11082
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10711
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10807
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10394
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7104
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5774
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4592
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.