Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Few things I don't understand
Message
De
19/05/2009 16:44:47
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01400762
Message ID:
01400810
Vues:
61
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everybody,
>
>I have a method in my BL that returns a datatable with many columns. I want to have my combobox to be bound to the table and being able to return selected row and bind textboxes to the information selected in this row.
>
>My questions are
>
>1. Why do I need to convert the result into the two fields dictionary (one being description and another being Guid.ToString()) and then using loop through the dictionary to bind the combobox - can I bind directly to the datatable - what are implications for the mobile app?
>
>2. Using dictionary this way I can not get back my item
>
>Here is what I tried:
>
>private void RefreshSelectedItemInfo()
> {
> string SelectedItem = this.cboItems.Text.Trim();
> if (SelectedItem!="")
> {
> string ItemPK;
> _inventoryEntries.TryGetValue(SelectedItem, out ItemPK);
>
> InventoryDS.ItemsDataTable dt = _inventoryBiz.GetDataByInventoryKey(ItemPK); //ItemPK should be Guid in the method - I can not cast to Guid
> }
> }
>
>I can use ItemNo as the second string (Pk) in my dictionary instead - I have another method to get item info by ItemNo, but all of this sounds like very strange, complex and convoluted way to get my info - should I go ahead changing my dictionary or there is a simpler way around?
>
>Thanks a lot in advance.

See 'Binding to a ComboBox' here:

http://www.akadia.com/services/dotnet_databinding.html#DataTable

Some more:

http://www.atakala.com/Browser/Item.aspx?user_id=amos&dict_id=65
http://msdn.microsoft.com/en-us/library/w67sdsex.aspx

And some ideas for inserting blank rows at the bottom of this one:
http://stackoverflow.com/questions/199642/c-how-to-insert-empty-field-in-combo-box-bound-to-datatable
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform