TableStyles[0].GridColumnStyles[0];
The numbers between the '[' and ']' are indexes for collections [0] is first item in coll and [1] is the 2nd item and so on
so my best gues is that: GridcolumnStyles has no entries , item 0 (first) does not exist or tablestyles has no entries , wich means that gridcolumnstyles has no entries as wel
sprContacts is a Datagrid right, posibly you have 2 add a column and/or a tablestyle
eg:
'Create tableStyle ExampleTableStyle = new DataGridTableStyle(); ExampleTableStyle.MappingName = "acounts";
'Create ColumnStyle DataGridColumnStyle myNullCol = new DataGridTextBoxColumn(); myNullCol.MappingName = "MyNillableField"; myNullCol.HeaderText = "Posibly Null"; myNullCol.NullText = "Null Text";
'add the columstyle 2 the tablestyle ExampleTableStyle.GridColumnStyles.Add(myNullCol); 'repeat this 4 all the colums
'Add tableStyle 2 the grid sprContacts.TableStyles.Add(ExampleTableStyle);
Remco
|