Click here to Skip to main content
15,922,007 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How to call a procedure Pin
rwestgraham12-Feb-05 17:53
rwestgraham12-Feb-05 17:53 
GeneralRe: How to call a procedure Pin
Mekong River13-Feb-05 3:14
Mekong River13-Feb-05 3:14 
Generalcutting video file Pin
mm_chanakaya12-Feb-05 8:48
mm_chanakaya12-Feb-05 8:48 
GeneralRe: cutting video file Pin
Mike the Red13-Feb-05 16:16
Mike the Red13-Feb-05 16:16 
GeneralRe: cutting video file Pin
mm_chanakaya14-Feb-05 5:57
mm_chanakaya14-Feb-05 5:57 
GeneralHelp controlling columns in datagrid Pin
Gaz@UK12-Feb-05 8:20
Gaz@UK12-Feb-05 8:20 
GeneralRe: Help controlling columns in datagrid Pin
Dave Kreskowiak14-Feb-05 4:53
mveDave Kreskowiak14-Feb-05 4:53 
GeneralRe: Help controlling columns in datagrid Pin
Gaz@UK14-Feb-05 21:38
Gaz@UK14-Feb-05 21:38 
Ok, thanks for that at least I'm in the right place.

In that case then please can you help me to understand when the following code doesn't work, it's probably something simple...

I'd really appreciate some assistance...thanks

What Happens > All the data loads fine, the Datagrid1 formating works ok, but the columns are not adopting the table styles I created!

coding...

-->Step 1 load up 'Product' Array with Data

-->Step 2 load up Column collection...

Private Sub LoadColumnCollection()


productColumnCollection.Add("Level3")
productColumnCollection.Add("Level4")
productColumnCollection.Add("Rep_ITEM")
productColumnCollection.Add("Description")
productColumnCollection.Add("Ext_Description")
productColumnCollection.Add("End_Date")
productColumnCollection.Add("Price_From")
productColumnCollection.Add("Price_To")
productColumnCollection.Add("Price_Comments")
productColumnCollection.Add("RRP")
productColumnCollection.Add("Min_ISP")
productColumnCollection.Add("Max_ISP")
productColumnCollection.Add("ISP%SIP")
productColumnCollection.Add("%Margin")
productColumnCollection.Add("Units")
productColumnCollection.Add("SIP")
productColumnCollection.Add("Pack_Priority")
productColumnCollection.Add("Exculsive")
productColumnCollection.Add("Despatch_Date")
productColumnCollection.Add("ITEM_Code")
productColumnCollection.Add("Lenght_Av.")
productColumnCollection.Add("Unit_EAN")
productColumnCollection.Add("Case_EAN")
productColumnCollection.Add("Outer_EAN")
productColumnCollection.Add("Length")
productColumnCollection.Add("Width")
productColumnCollection.Add("Height")
productColumnCollection.Add("Case_Length")
productColumnCollection.Add("Case_Width")
productColumnCollection.Add("Case_Height")
productColumnCollection.Add("Gross_Weight")
productColumnCollection.Add("H")
productColumnCollection.Add("Pallet_Weight")
productColumnCollection.Add("Cases_Per_Layer")
productColumnCollection.Add("Layers_Per_Pallet")
productColumnCollection.Add("Reason_For_Change")


End Sub
Private Sub LoadColumnNames()

Dim row As Integer
Dim dC As DataColumn

' set product table up...
productTable = New DataTable("Product Table")

' construct table columns and names...
Try

For Each Nm As String In productColumnCollection
dC = New DataColumn(Nm)
dC.DataType = System.Type.GetType("System.String")
productTable.Columns.Add(dC)
Next

Catch
End Try


End Sub

-->Step 3 load up Column names into table...

Private Sub LoadColumnNames()

Dim row As Integer
Dim dC As DataColumn

' set product table up...
productTable = New DataTable("Product Table")

' construct table columns and names...
Try

For Each Nm As String In productColumnCollection
dC = New DataColumn(Nm)
dC.DataType = System.Type.GetType("System.String")
productTable.Columns.Add(dC)
Next

Catch
End Try


End Sub

-->Step 4 load up Dataview...

Friend Sub ViewConstructor()

productTableViewDefault = New System.Data.DataView(productTable)
productTableViewDefault.AllowNew = False
productTableViewDefault.AllowDelete = False
productTableViewDefault.AllowEdit = True

End Sub

--> Step 5 Assign view to Datagrid1...

Datagrid1.Datasource = productTable


--> Step 6 Format Datagrid1...

With DataGrid1
.BackColor = Color.GhostWhite
.BackgroundColor = Color.Lavender
.BorderStyle = BorderStyle.None
.CaptionBackColor = Color.RoyalBlue
.CaptionFont = New Font("Tahoma", 12.0!, FontStyle.Bold)
.CaptionForeColor = Color.Bisque
.CaptionText = "Installed Software"
.Font = New Font("Tahoma", 8.0!)
.ParentRowsBackColor = Color.Lavender
.ParentRowsForeColor = Color.MidnightBlue
.HeaderBackColor = Color.DarkBlue
.HeaderForeColor = Color.White
End With

'set up style...
Dim objDataGridTableStyle As New DataGridTableStyle
Dim objTextCol As New DataGridTextBoxColumn

' set alternate background colour...
objDataGridTableStyle.AlternatingBackColor = Color.WhiteSmoke

' set the mappingname for the DataGridTableStyle...
objDataGridTableStyle.MappingName = "productTable"

'set column 1
objTextCol.MappingName = "Level3"
objTextCol.HeaderText = "Level >3"
objDataGridTableStyle.GridColumnStyles.Add(objTextCol)

'set column 2
objTextCol = New DataGridTextBoxColumn
objTextCol.MappingName = "Level4"
objTextCol.HeaderText = "Level >4"
objDataGridTableStyle.GridColumnStyles.Add(objTextCol)


'final step, add datagridtablestyle to datagrid...
DataGrid1.TableStyles.Add(objDataGridTableStyle)

End of code...

Thanks
GeneralGet Top 10 from a search engine Pin
Mohsen Saad12-Feb-05 7:37
Mohsen Saad12-Feb-05 7:37 
GeneralRe: Get Top 10 from a search engine Pin
Dave Kreskowiak13-Feb-05 5:52
mveDave Kreskowiak13-Feb-05 5:52 
GeneralRe: Get Top 10 from a search engine Pin
Mohsen Saad13-Feb-05 11:57
Mohsen Saad13-Feb-05 11:57 
GeneralRe: Get Top 10 from a search engine Pin
Dave Kreskowiak13-Feb-05 16:59
mveDave Kreskowiak13-Feb-05 16:59 
Generalconcatenating wav files Pin
gilliver12-Feb-05 5:43
gilliver12-Feb-05 5:43 
GeneralRe: concatenating wav files Pin
Dave Kreskowiak13-Feb-05 17:16
mveDave Kreskowiak13-Feb-05 17:16 
GeneralRe: concatenating wav files Pin
gilliver14-Feb-05 4:55
gilliver14-Feb-05 4:55 
Generaluser defined Reports in crystal Reporting Pin
Member 121109012-Feb-05 3:40
Member 121109012-Feb-05 3:40 
GeneralExecutable code from string for a treeview control Pin
ergolabos12-Feb-05 1:32
ergolabos12-Feb-05 1:32 
GeneralRe: Executable code from string for a treeview control Pin
Dave Kreskowiak12-Feb-05 7:03
mveDave Kreskowiak12-Feb-05 7:03 
GeneralExitWindowsEx API Problem !!! Pin
Basavaraj P.Umadi12-Feb-05 0:35
Basavaraj P.Umadi12-Feb-05 0:35 
GeneralRe: ExitWindowsEx API Problem !!! Pin
Dave Kreskowiak12-Feb-05 3:20
mveDave Kreskowiak12-Feb-05 3:20 
Questioncan i get vs.net 2005 Pin
Member 172677311-Feb-05 23:05
Member 172677311-Feb-05 23:05 
AnswerRe: can i get vs.net 2005 Pin
Dave Kreskowiak12-Feb-05 3:13
mveDave Kreskowiak12-Feb-05 3:13 
GeneralRe: can i get vs.net 2005 Pin
Anonymous13-Feb-05 5:44
Anonymous13-Feb-05 5:44 
GeneralRe: can i get vs.net 2005 Pin
Dave Kreskowiak13-Feb-05 5:51
mveDave Kreskowiak13-Feb-05 5:51 
GeneralRe: can i get vs.net 2005 Pin
jonathan1514-Feb-05 0:15
jonathan1514-Feb-05 0:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.