473,403 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Simple DataBinding Problem

How can I bind the following to a comboBox in the compact framework? I'm
looking at this example here:
http://samples.gotdotnet.com/quickst...FormsData.aspx

When I do the following, i just get the application name appearing in the
ComboBox.

Thanks in advance.


struct comboItem
{
private string name;
private string id;

public string Name
{
get{ return name; }
}
public string Id
{
get{ return id; }
}

public comboItem(string name, string id)
{
this.name = name;
this.id = id;
}
}

//create the items
comboItem[] items= new comboItem[3];
items[0] = new comboItem("London", "567567");
items[1] = new comboItem("Paris", "34535");
items[2] = new comboItem("Glasgow", "12312");

//bind to comboBox1
this.comboBox1.DataSource = items;
this.comboBox1.DisplayMember = "name";
this.comboBox1.ValueMember = ="id";
Nov 17 '05 #1
4 1106
Hi Davie,

In .NET compact framework, the code is the same as in .NET framework. I
tried your code on my machine. It works fine on the emulator.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 17 '05 #2
Thanks for your reply Kevin.

I have tried my code on a Desktop application and it works, when i come to
run this on smarpthone however I only get the name of the application
appearing in my combobox and not the desired result. I'm still using VS
2003 with the emulator and I've also tried it on my Smartphone 2003 device.
Both are still showing me the application name.

Do you have any other suggestions ?

Many thanks.


"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:mR**************@TK2MSFTNGXA01.phx.gbl...
Hi Davie,

In .NET compact framework, the code is the same as in .NET framework. I
tried your code on my machine. It works fine on the emulator.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 17 '05 #3
Problem solved.

Thanks.

"Davie" <Da***@newsgroup.nospam> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Thanks for your reply Kevin.

I have tried my code on a Desktop application and it works, when i come to
run this on smarpthone however I only get the name of the application
appearing in my combobox and not the desired result. I'm still using VS
2003 with the emulator and I've also tried it on my Smartphone 2003
device. Both are still showing me the application name.

Do you have any other suggestions ?

Many thanks.


"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:mR**************@TK2MSFTNGXA01.phx.gbl...
Hi Davie,

In .NET compact framework, the code is the same as in .NET framework. I
tried your code on my machine. It works fine on the emulator.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Nov 17 '05 #4

"Davie" <Da***@newsgroup.nospam> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Problem solved.

Thanks.

Why not help others by explaining what the solution was?

AP
Nottingham - UK
Nov 17 '05 #5

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

Similar topics

2
by: dave | last post by:
I have created a web form with 3 different inputs, 1 drop down and 2 list boxes. The drop down selection populates the two list boxes, and I can get this render once, no problem, I now want to...
0
by: Robert Ludig | last post by:
How do I bind a textbox to a simple string varaible with databinding? I managed to do the binding but unfortnatedly the textvox does not get updated when I change the string wich the textbox is...
4
by: Dan | last post by:
I'm databinding my DropDownList to a DataSet. How do I add a dummy record at the top of the combo box. In other words, suppose we are dealing with cars I want something like: <select...
4
by: Nathan Sokalski | last post by:
I have two databinding expressions (the first & last names from a DB) that I want to assign to the text property of a Label so that the result is LASTNAME,FIRSTNAME. At the moment, I have the...
9
by: J055 | last post by:
Hi I have a very simple configuration of the GridView with paging and sorting. When I do a postback the DataBinding event fires twice - in both the ProcessPostData and PreRender stages of the...
9
by: Nathan Sokalski | last post by:
I have a very simple UserControl which contains an Image and a Label, which I use to display an image with a caption. I am using this control inside a DataList, setting the two Public variables...
1
by: Owen Blacker | last post by:
I've spent loads of time Googling to try to work this one out and I'm sure it's something obvious. I get an InvalidOperationException reading "Databinding methods such as Eval(), XPath(), and...
7
by: Vlado Jasovic | last post by:
Hello, I'm using typed dataset for databinding to windows controls and I'm having some problems. I'm trying to move all business logic to datatable column_changing events and the problem that...
0
by: GS | last post by:
I definitely feel I don't have the basic understanding of windows form databinding for dotnet 2 or 3 despite reading the msdn power point on windows form data binding notes In particular, I...
0
by: opedog | last post by:
I'm monkeying around with databinding, trying to learn all the ins and outs. I'm populating a label from one of my business objects properties which is a string, however, I want some formatting done...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.