Remove + sign from datagrid?
-
Hello I have a problem that I can't find any solution to. I have an arraylist of objects that I want to show in a datagrid and that works just fine. The problem is when the objects themselves has an internal property that is an arraylist, then the datagrid will show the "+" sign att each row. I want the datagrid to show only the "parent" rows without drilldown features. For example
public class MyStuff { string stuff; public MyStuff() {} public MyStuff(string NewValue) { stuff = NewValue; } public Stuff { get{return stuff;} set{stuff = value;} } } arraylist MyList = new arraylist; for (int iI = 0, ii <10, ii++) mylist.add(new MyStuff(ii.tostring())) datgrid1.datasource = MyList
works just fine, butpublic class MySecondStuff { string stuff; public MySecondStuff(string NewValue) { stuff = NewValue; } public Stuff { get{return stuff;} set{stuff = value;} } } public class MyStuff { string stuff; arraylist arList = new arraylist(); public MyStuff(string NewValue) { stuff = NewValue; for (int iI = 0, ii <10, ii++) arList.add(new MySecondStuff(ii.tostring())) } public Stuff { get{return stuff;} set{stuff = value;} } } //and then arraylist MyList = new arraylist; for (int iI = 0, ii <10, ii++) mylist.add(new MyStuff(ii.tostring())) datgrid1.datasource = MyList
Will show the parent MyStuff correctly in the datagrid but each row will have the "+" sign next to it and allow the user to see the MySecondStuff class under it. Can anyone please say how I can remove the "+" sign when working with arraylist or collections in the datagrid? I now the code above doesnt work, just wrote it to explain how the classes are built when they are viewd in a datagrid.:-O Best regards /Marcus