G
Guest
Hi,
i've a problem. I want hide column in datagrid.I've used tablestyle but non
display nothing.
The code is:
Dim cn As New SqlCeConnection(cs)
sqlDA = New SqlCeDataAdapter("SELECT * FROM ANAGRAFICA WHERE COGNOME
like '%" & TxtCerca.Text & "%' or NOME like '%" & TxtCerca.Text & "%'" & "
ORDER BY COGNOME ASC", cn)
sqlDS = New DataSet
sqlDA.Fill(sqlDS, "Anagrafica")
PnlCerca.Enabled = False
Dim dgts As New DataGridTableStyle
dgts.MappingName = "Anagrafica"
Dim c As New DataGridTextBoxColumn
c.MappingName = "Id"
c.HeaderText = "Id"
c.Width = 0
c.NullText = ""
dgts.GridColumnStyles.Add(c)
c = New DataGridTextBoxColumn
c.MappingName = "Cognome"
c.HeaderText = "Cognome"
c.Width = 20
c.NullText = ""
dgts.GridColumnStyles.Add(c)
c = New DataGridTextBoxColumn
c.MappingName = "Nome"
c.HeaderText = "Nome"
c.Width = 10
c.NullText = ""
dgts.GridColumnStyles.Add(c)
c = New DataGridTextBoxColumn
c.MappingName = "Indirizzo"
c.HeaderText = "Indirizzo"
c.Width = 0
c.NullText = ""
dgts.GridColumnStyles.Add(c)
c = New DataGridTextBoxColumn
c.MappingName = "Rata"
c.HeaderText = "Rata"
c.Width = 0
c.NullText = ""
dgts.GridColumnStyles.Add(c)
c = New DataGridTextBoxColumn
c.MappingName = "Tipologia"
c.HeaderText = "Tipologia"
c.Width = 0
c.NullText = ""
dgts.GridColumnStyles.Add(c)
c = New DataGridTextBoxColumn
c.MappingName = "Camponote"
c.HeaderText = "Camponote"
c.Width = 0
c.NullText = ""
dgts.GridColumnStyles.Add(c)
GrdCerca.TableStyles.Add(dgts)
GrdCerca.DataSource = sqlDS.Tables("Anagrafica")
Can anyone help me?
i've a problem. I want hide column in datagrid.I've used tablestyle but non
display nothing.
The code is:
Dim cn As New SqlCeConnection(cs)
sqlDA = New SqlCeDataAdapter("SELECT * FROM ANAGRAFICA WHERE COGNOME
like '%" & TxtCerca.Text & "%' or NOME like '%" & TxtCerca.Text & "%'" & "
ORDER BY COGNOME ASC", cn)
sqlDS = New DataSet
sqlDA.Fill(sqlDS, "Anagrafica")
PnlCerca.Enabled = False
Dim dgts As New DataGridTableStyle
dgts.MappingName = "Anagrafica"
Dim c As New DataGridTextBoxColumn
c.MappingName = "Id"
c.HeaderText = "Id"
c.Width = 0
c.NullText = ""
dgts.GridColumnStyles.Add(c)
c = New DataGridTextBoxColumn
c.MappingName = "Cognome"
c.HeaderText = "Cognome"
c.Width = 20
c.NullText = ""
dgts.GridColumnStyles.Add(c)
c = New DataGridTextBoxColumn
c.MappingName = "Nome"
c.HeaderText = "Nome"
c.Width = 10
c.NullText = ""
dgts.GridColumnStyles.Add(c)
c = New DataGridTextBoxColumn
c.MappingName = "Indirizzo"
c.HeaderText = "Indirizzo"
c.Width = 0
c.NullText = ""
dgts.GridColumnStyles.Add(c)
c = New DataGridTextBoxColumn
c.MappingName = "Rata"
c.HeaderText = "Rata"
c.Width = 0
c.NullText = ""
dgts.GridColumnStyles.Add(c)
c = New DataGridTextBoxColumn
c.MappingName = "Tipologia"
c.HeaderText = "Tipologia"
c.Width = 0
c.NullText = ""
dgts.GridColumnStyles.Add(c)
c = New DataGridTextBoxColumn
c.MappingName = "Camponote"
c.HeaderText = "Camponote"
c.Width = 0
c.NullText = ""
dgts.GridColumnStyles.Add(c)
GrdCerca.TableStyles.Add(dgts)
GrdCerca.DataSource = sqlDS.Tables("Anagrafica")
Can anyone help me?