Click here to Skip to main content
15,912,578 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# and Custom C++ interfaces Pin
vad_kr27-Feb-05 21:06
vad_kr27-Feb-05 21:06 
GeneralRe: C# and Custom C++ interfaces Pin
Heath Stewart28-Feb-05 8:31
protectorHeath Stewart28-Feb-05 8:31 
GeneralCodepage in StreamReader Pin
matejka25-Feb-05 2:49
matejka25-Feb-05 2:49 
GeneralTreeView Problem Pin
WDI25-Feb-05 2:45
WDI25-Feb-05 2:45 
GeneralRe: TreeView Problem Pin
S. Senthil Kumar25-Feb-05 3:35
S. Senthil Kumar25-Feb-05 3:35 
GeneralFolder Icon Pin
mohamed seif25-Feb-05 1:33
mohamed seif25-Feb-05 1:33 
GeneralRe: Folder Icon Pin
Luis Alonso Ramos25-Feb-05 6:35
Luis Alonso Ramos25-Feb-05 6:35 
QuestionRemove + sign from datagrid? Pin
Marcus_225-Feb-05 1:16
Marcus_225-Feb-05 1:16 
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, but

public 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.Blush | :O

Best regards
/Marcus
GeneralC# custom events Pin
GaMBiT_KC25-Feb-05 0:58
GaMBiT_KC25-Feb-05 0:58 
GeneralRe: C# custom events Pin
sreejith ss nair25-Feb-05 1:30
sreejith ss nair25-Feb-05 1:30 
GeneralRe: C# custom events Pin
GaMBiT_KC25-Feb-05 1:37
GaMBiT_KC25-Feb-05 1:37 
GeneralRe: C# custom events Pin
GaMBiT_KC25-Feb-05 1:35
GaMBiT_KC25-Feb-05 1:35 
Generalc# remoting on windows xp pro is much slower compared to windows 2k pro Pin
Member 154579524-Feb-05 23:19
Member 154579524-Feb-05 23:19 
GeneralPocket PC disable toolbar Start Pin
sevan24-Feb-05 22:51
sevan24-Feb-05 22:51 
GeneralRe: Pocket PC disable toolbar Start Pin
Dave Kreskowiak25-Feb-05 5:01
mveDave Kreskowiak25-Feb-05 5:01 
Generalrotation using StringFormatFlags.DirectionVertical; Pin
dorwin24-Feb-05 22:45
dorwin24-Feb-05 22:45 
Generalas400 connection Pin
Reinier van de Wetering24-Feb-05 20:24
Reinier van de Wetering24-Feb-05 20:24 
GeneralRe: as400 connection Pin
spif200124-Feb-05 21:31
spif200124-Feb-05 21:31 
Generalquestion about ref Pin
Anonymous24-Feb-05 16:32
Anonymous24-Feb-05 16:32 
GeneralRe: question about ref Pin
S. Senthil Kumar24-Feb-05 17:16
S. Senthil Kumar24-Feb-05 17:16 
GeneralRe: question about ref Pin
sreejith ss nair25-Feb-05 1:46
sreejith ss nair25-Feb-05 1:46 
GeneralRe: question about ref Pin
Anonymous25-Feb-05 15:27
Anonymous25-Feb-05 15:27 
GeneralPerformance Evaluation Pin
tonyhearty24-Feb-05 14:29
tonyhearty24-Feb-05 14:29 
GeneralRe: Performance Evaluation Pin
PaleyX24-Feb-05 14:57
PaleyX24-Feb-05 14:57 
GeneralDisappearing Help window Pin
LannieK24-Feb-05 11:29
LannieK24-Feb-05 11:29 

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.