Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to set the DataGridViewComboBoxColumn in Datagriderv
Message
De
22/12/2010 05:10:04
 
 
À
22/12/2010 04:46:46
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01493571
Message ID:
01493572
Vues:
57
>
>HI, All
>i don't know how to set the data structure DataGridViewTextBoxColumn, DataGridViewComboBoxColumn in Datagriderview 
> < In this time, i want to change the  countryid as 國家........Dim colcombo As New DataGridViewComboBoxColumn
> ' and i want countryid as 國家, is select in country talbe 's key
>' so countryid as 國家 is a foreignkey in this table, but in country table is primary key
>
>My table has 3 fields,  this is my code
>
>Dim qs As String = "select storeid as 貨主編號, countryid as 國家 , storename as 貨主名稱 from storer"
>
>            da = New SqlDataAdapter(qs, cn)
>            da.Fill(ds, "Storer")
>
>            Me.StorerBindingSource.DataSource = ds.Tables("Storer")
>
>            Me.dg.DataSource = Me.StorerBindingSource
>
>            Dim col As New DataGridViewTextBoxColumn
>            col = dg.Columns(0)
>            col.MaxInputLength = 10
>            col = dg.Columns(1)                             
>            col.MaxInputLength = 20                             
>            col = dg.Columns(2)                                     
>            col.MaxInputLength = 50
>
dg.Columns(0).MaxInputLength = 10
dg.Columns(1).MaxInputLength = 20                             
dg.Columns(2).MaxInputLength = 50
There is no need of col definition.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform