A
Arial
Hi all!
What is the best way to hold some kind of "invariant" reference to access
grid columns (any grid, not only MS grids)?
Currently I use structs, like that:
struct ColLayers{
public string Col1;
public string Col2;
public string Col3;
public Init()
{
Col1="MyName1";
Col2="MyName2";
Col3="MyName3";
}
}
later in code I do
ColLayer C=new ColLayers();
C.Init();
so I can refer to grid like this (see the intellisense)
grid.Row[0].Column[C.Col1].Value="xx";
grid.Row[0].Column[C.Col2].Value="yy";
.....
is there some shorter/smarter way to do that in C#?
I presume enums are not the option since
they require .ToString() casting.
What is the best way to hold some kind of "invariant" reference to access
grid columns (any grid, not only MS grids)?
Currently I use structs, like that:
struct ColLayers{
public string Col1;
public string Col2;
public string Col3;
public Init()
{
Col1="MyName1";
Col2="MyName2";
Col3="MyName3";
}
}
later in code I do
ColLayer C=new ColLayers();
C.Init();
so I can refer to grid like this (see the intellisense)
grid.Row[0].Column[C.Col1].Value="xx";
grid.Row[0].Column[C.Col2].Value="yy";
.....
is there some shorter/smarter way to do that in C#?
I presume enums are not the option since
they require .ToString() casting.