Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello,

 

When I run my windows application, the data grid comes up with a "+" in it.

 

When you click that, it lists the data table name.

 

And then if you click this, it finally lists the contents of the dataset.

 

How can I have the datagrid display its contents from the very start, instead of having to click the "+" and the data table name?

 

Thank you,

 

Burak

Posted
Set the datasource to the dataset's table

i.e. DataGrid1.DataSource = ds.tables(0)

 

Do you know how to set the header names in the data grid?

 

For some reason, if you say "select CRS_TITLE as Title..." it does not work.

 

I found this code but it didn't work.

 

Dim gs As New DataGridTableStyle

Dim cs As DataGridColumnStyle

cs.MappingName = "CRS_TITLE"

cs.HeaderText = "Title"

gs.GridColumnStyles.Add(cs)

 

dtg.TableStyles.Add(gs)

dtg.Refresh()

 

Thanks,

 

Burak

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...