473,804 Members | 3,320 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(strin g name, string id)
{
this.name = name;
this.id = id;
}
}

//create the items
comboItem[] items= new comboItem[3];
items[0] = new comboItem("Lond on", "567567");
items[1] = new comboItem("Pari s", "34535");
items[2] = new comboItem("Glas gow", "12312");

//bind to comboBox1
this.comboBox1. DataSource = items;
this.comboBox1. DisplayMember = "name";
this.comboBox1. ValueMember = ="id";
Nov 17 '05 #1
4 1118
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.mic rosoft.com> wrote in message
news:mR******** ******@TK2MSFTN GXA01.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***@newsgrou p.nospam> wrote in message
news:%2******** ********@TK2MSF TNGP14.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.mic rosoft.com> wrote in message
news:mR******** ******@TK2MSFTN GXA01.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***@newsgrou p.nospam> wrote in message
news:%2******** ********@tk2msf tngp13.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
1191
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 change the contents, of either list box based upon multiple selections in the list boxes. In short I want to re-render the list box's contents, based on the list box choices, UNFORTUNATELY, it seems to only appned new choices, and not re-write the...
0
413
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 bound to. I though this automation is on of the purposes of the databinding ... ? What am I doing wrong ? See this little example code: using System;
4
1313
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 name="cboCars"> <option value="0">Select a car</option> <option value="1">Ford Mustang</option> .... <option value="5">Mitsubishi Eclipse</option>
4
1660
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 following which I know works when I use it by itself: text='<%# DataBinder.Eval(Container,"DataItem.membernames.lname") %>' What I need to do is somehow concatenate this databinding expression, a comma, and another databinding expression for the...
9
24816
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 page life cycle. In this example the event fires twice when a) GridView EnableViewState=False and any image type control in the <columns/> element. When either EnableViewState is set to true or the image button is removed, the event fires once....
9
2321
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 using attributes in the *.aspx page. Everything displays great for the initial load, but whenever I try to add or delete an item (I have controls to do this on the page), it does not seem to be recieving any values for the public variables. Here is...
1
16262
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 Bind() can only be used in the context of a databound control" when I start my page. Unless I'm missing something obvious, this is *not* the same issue as the "2-way databinding cascading lists" issue in...
7
2598
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 I'm having is when I change some other column, control value doesn't update immediately until I call endcurrentedit on bindingmanager which doesnt happen until user click update button.
0
1012
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 find myself struggling with row leave and validate events at the windows detail form level.. For row validate event I either get too many false positive for detecting rowchange/ data modification or get the delayed firing after data modification...
0
1137
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 on the string first. I got this working using the binding's Format event. But, I want to go one step further. Instead of using the Format event, I'm trying to set the FormatString and FormatInfo properties to make the databinding go through the...
0
10558
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
10318
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
10302
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
10069
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
9130
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7608
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
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
2
3802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.