locked
How to set cell color and modify its text via datgarid in VB RRS feed

  • Question

  • Hi:

    I am a newbie to VB.Net, and for work I need to use it to develop new UI.

    And the problem comes from how to set cell color and modify its text via datgarid, 

    I use the following code:

    Me.DataGrid1 = New System.Windows.Forms.DataGrid()
    Me.SqlDataAdapter1 = New System.Data.SqlClient.SqlDataAdapter()
    Me.SqlDataAdapter1.Fill(Me.DataSet1, "TEST")
    Dim myGridTableStyle As DataGridTableStyle = New DataGridTableStyle()
    Me.DataGrid1.TableStyles.Add(myGridTableStyle)
    myGridTableStyle.GridColumnStyles(1).Width = 120
    

    Is there any way to change the font color of column 2 and modify its cell text, 

    Any instructions is highly appreciated, thanks a lot.


    • Moved by Dave PatrickMVP Friday, December 25, 2020 1:32 PM looking for forum
    Friday, December 25, 2020 8:53 AM

Answers

  • I'd try asking for help over here.

    dotnet-visual-basic - Microsoft Q&A

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    • Proposed as answer by Dave PatrickMVP Wednesday, December 30, 2020 10:08 PM
    • Marked as answer by Guido Franzke Monday, January 4, 2021 8:17 AM
    Friday, December 25, 2020 1:32 PM