Results 1 to 2 of 2

Thread: DataGridTableStyle

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2004
    Posts
    22

    DataGridTableStyle

    My first column is a DataGridBoolColumn and does not show in the grid.
    I know that the column is added to the tablestyle (and it is not part of the dataset)
    Any ideas?


    Private Sub LoadGrid()
    Dim strSql As String
    Dim objdl As New DYJ_DL.DLCoordinator()

    ds = objdl.spCoordinator_selHist(ParticipantId)

    grdCoordinator.DataSource = ds
    grdCoordinator.DataMember = "Table"

    AddCustomDataTableStyles(ds)

    End Sub

    Private Sub AddCustomDataTableStyles(ByVal ds As DataSet)
    Dim tsTableStyle As New DataGridTableStyle()
    Dim tcTextCol As DataGridTextBoxColumn
    Dim intCounter As Integer
    Dim tcCheckBoxCol As DataGridBoolColumn

    grdCoordinator.TableStyles.Clear()

    'Add Delete CheckBox Column
    tcCheckBoxCol = New DataGridBoolColumn()
    tcCheckBoxCol.HeaderText = "Delete"
    tcCheckBoxCol.Width() = 100
    tcCheckBoxCol.NullValue = False
    tcCheckBoxCol.NullText = False
    tsTableStyle.GridColumnStyles.Add(tcCheckBoxCol)

    tsTableStyle.MappingName = ds.Tables(0).TableName()
    For intCounter = 0 To ds.Tables(0).Columns.Count() - 1
    tcTextCol = New DataGridTextBoxColumn()
    tcTextCol.MappingName = ds.Tables(0).Columns.Item(intCounter).ColumnName
    tcTextCol.HeaderText = ds.Tables(0).Columns.Item(intCounter).ColumnName

    Select Case tcTextCol.MappingName()
    Case "Phone1"
    tcTextCol.Width() = 0
    Case "Coordinator"
    tcTextCol.Width() = 200
    Case "From", "To"
    tcTextCol.Width() = 160

    End Select
    tsTableStyle.GridColumnStyles.Add(tcTextCol)
    Next

    grdCoordinator.TableStyles.Add(tsTableStyle)
    End Sub

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    Maybe this is what you are looking for:
    http://www.syncfusion.com/faq/winforms/search/787.asp
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

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