databinding

Hi
        datagridview.AutoGenerateColumns = False
        datagridview.AutoSize = True
        datagridview.DataSource = _ds.Tables(0)

 How do i bind   a
 
datagridview.column(0) to ds.tables(0).column(1)

meaning

datagridview.column(0).datasource = ds.tables(0).column(1)

thanks
LVL 18
vbturboAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
p_davisConnect With a Mentor Commented:
did you add a column to the datagridview?
0
 
p_davisCommented:
datagridview.Columns[0].DataPropertyName = something // where something is a property or column in the datasource
0
 
vbturboAuthor Commented:
davis

Ive already tried this but it throws a exception

dggridNyeRyk.Columns[0].DataPropertyName = _NyeRykkereData.Tables[0].Columns[0].ToString()

{"the Index was out of bounds .
Parameternavn: index"}

but i got 30 columns in the table
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
p_davisCommented:
dggridNyeRyk.Columns[0].DataPropertyName = _NyeRykkereData.Tables[0].Columns[0].ColumnName
0
 
vbturboAuthor Commented:
still throws

{"the Index was out of bounds .
Parameternavn: index"}

ive filled and inspected the dataset table before the propertyname is assigned.
so i know for sure that there are data present.


0
 
vbturboAuthor Commented:
woops ....thanks
0
 
p_davisCommented:
np -- have fun

P
0
All Courses

From novice to tech pro — start learning today.