Datagrid with Arraylist

Please give me a solution to customise DataGrid in Windows forms.

My datasource is a class inherited from ArrayList. I had to format the datagrid column's Header Name and Visibility

How to format datagrid with datagridTextStyle class ? What should be mapping name in the above case ?

The code samples found in MSDn web site is not working...

Hope i wil get a solution soon

[392 byte] By [Raju_Sreenivasan] at [2007-12-17]
# 1
Use ArrayList as the mapping name for the table style
KenTucker at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...
# 2
I have tried Mappingname as ArrayList
but its not working (no errors)

The code that i tried is given below ..is there any other design time properties that i have to set before this code ?

Dim widTable As New DataGridTableStyle
Dim modelColumn As New DataGridTextBoxColumn
Dim objData As New CSBSalary.BranchData
Dim objBranches As CSBSalary.MyObjects.Branches

objBranches = objData.getBranches(901) ' Returns ArrayList
dgdTest.SetDataBinding(objBranches, "")
widTable.MappingName = "ArrayList"

modelColumn.MappingName = "BranchName"
modelColumn.HeaderText = "Name of Branch"
widTable.GridColumnStyles.Add(modelColumn)

dgdTest.TableStyles.Clear()
dgdTest.TableStyles.Add(widTable)

Raju_Sreenivasan at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...
# 3
You need to set the DataGridTableStyle MappingName to the name of the type of your array list.

For instance, if your array list is declared like this:

Public Class MyArrayList

Inherits System.Collections.ArrayList

End Class

Then set the MappingName to MyArrayList:

widTable.MappingName = "MyArrayList"

Hope this helps.

DanielHerlingMicrosoft at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...
# 4
Hi Daniel

Thank you very much .... for the help
I had confusion with MappingName of DatagridTableStyle..

the problem is solved..

Raju_Sreenivasan at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...