PDA

Click to See Complete Forum and Search --> : problems with tablestyle!


ronlahav
Jan 9th, 2003, 09:23 AM
ill describe it in shortage - its more readible in the word file attached

i have
1) dataset - dsCompanies
tables:
a) .T_ConnectionDetails (conndetails_Code (PK), conndetails_conntype_Code(FK)
b)T_ConnectionType(conntype_Code(PK), conntype_Name)
:) i guess you know those 2 fellows!

2)datagrid - grdCompConnWay

and the following code:
public Class frmCompanies
Inherits System.Windows.Forms.Form
#Region "Members Of Class"
Private m_nStatus As Integer
Dim res As DataTable
#End Region
#End Region
'Private Sub grdConnWayShow()
res = New dsCompanies.T_ConnectionDetailsDataTable()
res = DsCompanies1.T_ConnectionDetails.Clone()

Dim grdtbstConnnWay As DataGridTableStyle = New DataGridTableStyle()
Dim txtCol As DataGridTextBoxColumn = New DataGridTextBoxColumn()

With txtCol
.MappingName = "conndetails_Code"
.HeaderText = "ос" '
.Width = 35
.Alignment = HorizontalAlignment.Right '
.ReadOnly = True '
End With '
grdtbstConnnWay.DataGrid = Me.grdCompConnWay
grdtbstConnnWay.GridColumnStyles.Add(txtCol)
'grdtbstConnnWay.MappingName = "DsCompanies1.T_ConnectionDetails" -
grdCompConnWay.TableStyles.Add(grdtbstConnnWay)
Me.grdCompConnWay.DataSource = res
my question is when i load the form and the grid i just get the columns headers withought any data and without the one col in the datatable which i created!!!!!!!!! H E L P!!!!?????
i have tryied to change the order of the 5 last centances and it also didnt work!

Lunatic3
Jan 9th, 2003, 11:23 AM
Did you fill your dataset in your code?

ronlahav
Jan 10th, 2003, 12:37 AM
yup! actually even if i didnt fill it - i think it should pear without data and with the one column whic i created doesnt it?

Lunatic3
Jan 10th, 2003, 03:26 AM
First: I dont know why you are using 'res' and cloning the table while you can directly work with the original table.

Second: Provided that you fill your dataset this should definitly work for you.


Private Sub grdConnWayShow()

Dim grdtbstConnnWay As DataGridTableStyle = New DataGridTableStyle()
Dim txtCol As DataGridTextBoxColumn = New DataGridTextBoxColumn()

With txtCol
.MappingName = "conndetails_Code"
.HeaderText = "ос" '
.Width = 35
.Alignment = HorizontalAlignment.Right '
.ReadOnly = True '
End With '

grdtbstConnnWay.DataGrid = Me.grdCompConnWay
grdtbstConnnWay.GridColumnStyles.Add(txtCol)
grdtbstConnnWay.MappingName = DsCompanies1.T_ConnectionDetails.TableName '****
grdCompConnWay.TableStyles.Add(grdtbstConnnWay)
Me.grdCompConnWay.DataSource = DsCompanies1.T_ConnectionDetails '****

End Sub