Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to set the DataGridViewComboBoxColumn in Datagriderv
Message
 
To
22/12/2010 04:46:46
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01493571
Message ID:
01493572
Views:
56
>
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform