Hi support,
I read this blog which is awesome, I implemented the same in my proj,Only problem is that upon user selection i make some of the columns invisible ,because of that Secondary header alignments gone missing.In btw I am able to change the content of secondary header,here are the changes i made.
in mainpage.xaml.cs
in commonheader.xaml.cs
in ColumnGroupbehaviour.cs
Suggest some solution
Thanks
I read this blog which is awesome, I implemented the same in my proj,Only problem is that upon user selection i make some of the columns invisible ,because of that Secondary header alignments gone missing.In btw I am able to change the content of secondary header,here are the changes i made.
in mainpage.xaml.cs
var rows = gvData.ChildrenOfType<CommonHeader>();
foreach
(var row
in
rows)
{
if
(row.Name ==
"Second1"
)
row.ColumnSpan = 5;
if
(row.Name ==
"Third1"
)
{
row.StartColumnIndex = 7;
row.ColumnSpan = 6;
}
if
(row.Name ==
"Fourth1"
)
{
row.StartColumnIndex = 13;
row.ColumnSpan = 6;
}
}
public
static
readonly
DependencyProperty ColumnIndex =
DependencyProperty.Register(
"StartColumnIndex"
,
typeof
(
int
),
typeof
(CommonHeader),
new
PropertyMetadata(0));
public
static
readonly
DependencyProperty ColSpan =
DependencyProperty.Register(
"ColumnSpan"
,
typeof
(
int
),
typeof
(CommonHeader),
new
PropertyMetadata(0));
public
string
Caption
{
get
{
return
(
string
)
this
.GetValue(CaptionProperty);
}
set
{
this
.SetValue(CaptionProperty, value);
}
}
public
int
StartColumnIndex
{
get
{
return
(
int
)
this
.GetValue(ColumnIndex);
}
set
{
this
.SetValue(ColumnIndex, value);
}
}
public
int
ColumnSpan
{
get
{
return
(
int
)
this
.GetValue(ColSpan);
}
set
{
this
.SetValue(ColSpan, value);
}
}
in ColumnGroupbehaviour.cs
protected
override
void
OnDetaching()
{
base
.OnDetaching();
this
.AssociatedObject.DataLoaded +=
new
EventHandler<EventArgs>(AssociatedObject_DataLoaded);
}
void
AssociatedObject_DataLoaded(
object
sender, EventArgs e)
{
PlaceSecondaryHeader();
}
Suggest some solution
Thanks