Results 1 to 4 of 4

Thread: problems with tablestyle!

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2003
    Posts
    175

    Unhappy problems with tablestyle!

    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!
    Attached Files Attached Files

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    Did you fill your dataset in your code?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2003
    Posts
    175
    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?

  4. #4
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    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.

    VB Code:
    1. Private Sub grdConnWayShow()
    2.  
    3. Dim grdtbstConnnWay As DataGridTableStyle = New DataGridTableStyle()
    4. Dim txtCol As DataGridTextBoxColumn = New DataGridTextBoxColumn()
    5.  
    6. With txtCol
    7. .MappingName = "conndetails_Code"
    8. .HeaderText = "îñ" '
    9. .Width = 35
    10. .Alignment = HorizontalAlignment.Right '
    11. .ReadOnly = True '
    12. End With '
    13.  
    14. grdtbstConnnWay.DataGrid = Me.grdCompConnWay
    15. grdtbstConnnWay.GridColumnStyles.Add(txtCol)
    16. grdtbstConnnWay.MappingName = DsCompanies1.T_ConnectionDetails.TableName  '****
    17. grdCompConnWay.TableStyles.Add(grdtbstConnnWay)
    18. Me.grdCompConnWay.DataSource = DsCompanies1.T_ConnectionDetails '****
    19.  
    20. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width