Last post Nov 21, 2008 04:10 AM by srikanthsundaram
Nov 15, 2008 10:43 AM|Sarvis|LINK
I'm writing a "simple" web app for web enabled phones. I'm using ObjectList to show a list of service orders, and need to allow certain commands to be fired on those. All is fine, more or less, with the layout and everything... but in the ItemCommand event
the MobileListItem in the command argument does not have it's Value or Text property set. I can't find the Text or Value in the Items array of the ObjectList either. I've got no idea how to get the actual value...
The ObjectList is being bound in codebehind, but I don't see a place to set the DataTextField or DataValueField like I would in a normal ASP.NET ListControl so I'm a little confused.
How do I get the value of a selected item?
Nov 16, 2008 02:31 PM|Sarvis|LINK
Nov 21, 2008 02:44 AM|Guang-Ming Bian - MSFT|LINK
We can set text and value like below:
this.ObjectList1.DataSource = dt;
this.ObjectList1.Items.Text = "text";
this.ObjectList1.Items.Value = "textvalue";
If you set it, you will get the value in ItemCommand.
Guang-Ming Bian - MSFT
Nov 21, 2008 04:10 AM|srikanthsundaram|LINK
hi is your ObjectList displaying items in a tabular format in the emulator?? Im using an ObjectList which takes a datasource from a dataset... It displays the data fine (in tabular form) in internet explorer.. but no luck in the emulator... Do help me in
this issue... thanks