Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
350 | Jun 9,2002 07:35 AM UTC | Jun 10,2002 11:49 AM UTC | WinForms | 3 |
![]() |
Tags: FAQ |
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'add a datasource to the grid Me.DataGrid1.DataSource = Nothing SqlDataAdapter1.Fill(Me.DataSet11, "FAQEntries") Me.DataGrid1.DataSource = Me.DataSet11.Tables("FAQEntries") 'create a tablestyle based on the current contents Dim myCurrencyManager As CurrencyManager myCurrencyManager = CType(BindingContext(Me.DataSet11, "FAQEntries"), CurrencyManager) Dim ts As DataGridTableStyle ts = New DataGridTableStyle(myCurrencyManager) 'add the tablestyle to grid DataGrid1.TableStyles.Add(ts) 'modify particular columnstyles in the tablestyle ts.GridColumnStyles(1).Alignment = HorizontalAlignment.Right ts.GridColumnStyles(2).Width = 30 ts.GridColumnStyles(4).HeaderText = "test" CType(ts.GridColumnStyles(4), DataGridTextBoxColumn).Format = "h:mm" End Sub
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.