Hi,
I have two level object related hierarchy grid.
Child object field depends on Parent object field.
When changing a value in parent object it does not update children rows.
But it updates parent row itself. We can see it on C field which depends on that value too.
Here is the code:
I have two level object related hierarchy grid.
Child object field depends on Parent object field.
When changing a value in parent object it does not update children rows.
But it updates parent row itself. We can see it on C field which depends on that value too.
Here is the code:
public
partial
class
RadForm1 : Telerik.WinControls.UI.RadForm
{
List<A> glist;
public
RadForm1()
{
InitializeComponent();
glist =
new
List<A>();
A objA =
new
A();
objA.B = 10;
objA.L.Add(
new
B(
"asdf1"
));
objA.L.Add(
new
B(
"asdf2"
));
objA.L.Add(
new
B(
"asdf3"
));
objA.L.Add(
new
B(
"asdf4"
));
A objB =
new
A();
objB.B = 20;
objB.L.Add(
new
B(
"f1"
));
objB.L.Add(
new
B(
"f2"
));
objB.L.Add(
new
B(
"f3"
));
objB.L.Add(
new
B(
"F4"
));
glist.Add(objA);
glist.Add(objB);
gv.DataSource = glist;
gv.AutoGenerateHierarchy =
true
;
gv.Columns[
"L"
].IsVisible =
false
;
}
class
A
{
List<B> list;
int
b;
int
c;
public
A()
{
list =
new
List<B>();
}
public
List<B> L
{
get
{
return
this
.list; }
set
{
this
.list = value; }
}
public
int
B
{
get
{
return
this
.b;}
set
{
this
.b = value;
this
.c = value * 5;
foreach
(B bb
in
L)
bb.a = value;
}
}
public
int
C
{
get
{
return
this
.c; }
}
}
class
B
{
int
_a;
string
_b;
public
B()
{ }
public
B(
string
stringparam)
{
b = stringparam;
}
public
int
a
{
get
{
return
this
._a; }
set
{
this
._a = value; }
}
public
string
b
{
get
{
return
this
._b; }
set
{
this
._b = value; }
}
}
}