Hi.
I have a problem with the list view column header,
the problem :
1-I want to fix the header width and stop column resizing,
so i did implement a class . this is the code:
public class FixedWidthColumn : GridViewColumn
{
static FixedWidthColumn()
{
widthProperty.OvverideMetadata(typeof(FixedWidthColumn),
new FrameworkPropertyMetadata(null,new CoerceValueCallBack(OnCoerceWidth)));
}
private static object OnCoerceWidth(DependencyObject o,object baseValue)
{
FixedWidthColumn fws = o as FixedWidthColumn;
if(fws != null)
return fws.FixedWidth;
return baseValue;
}
public double FixedWidth
{
get{return (double)GetValue(FixedWidthProperty);}
set{SetValue(FixedWidthProperty,value);}
}
public static readonly DependencyProperty FixedWidthProperty=
DependencyProperty.Register
("FixedWidth",
typeof(double),
typeof(FixedWidthColumn),
new FrameworkPropertyMetadata(double.NaN,new PropertyChangedCallBack(OnFixedWidthChanged))
);
private static void OnFixedWidthChanged(DependencyObject o,DependencyPropertyChangedEventArgs e)
{
FixedWidthColumn fws=o as FixedColumn;
if(fes != null)
fws.CoerceValue(WidthProperty);
}
}
this is the class when i use it in the xmal code it work the width is fixed and can not change the cloumn size ,
the problem is i want to add a Handler m her the error appear
this what i did write in the Xaml code:
<listview.view>
<gridview>
<customgridheader:fixedwidthcolumn fixedwidth="110" header="Test1" mouse.mouseup="OnTestClick" xmlns:customgridheader="#unknown" />
</gridview>
</listview.view>
the error is FixedWidthColumn does not contain definition for AddHAndler.
How can i definie the add handler???
and how can i change the cursor style when the mouse is over the header ??
this my problem , thx for your passion on me and i hope that any one can help me in this problem