Hello,
So far i have been reading a lot about WPF in a short time and can't solve some problems. Hope you guys cand clear the air for me.
1) I'm looking to implement some animations for the xamdatagrid rows. What i need is to create something like what the carousel does, expand the size of a row when i drag the mouse over it (i need a scaling effect on my datarow). Is that possible? And if yes, can that be done to a cell or any sort of control/component ? How?
2) Can a datagrid cell contain a panel or any sort of container that holds another custom usercontrol, like the carouselPanel? (i know it may seem stupid...but it may work, in classic infra with a little creation filter rewriting you could do just about anything :D )
3) If there is an accessible function just like CreationFilter, is there any way to get some sort of support for rewriting it, so that we may modify WPF controls?
4) I see here valuelists are not so popular, do you recomand not using them?
Thank you, I hope someone can answer nr 1 and 2 since they are a more pressing matter.
thank you for your indications, it works just fine!
here's the code for getting the cellvaluepersenter on any mouse event
void xamDataGrid1_PreviewMouseMove(object sender, MouseEventArgs e)
{
DependencyObject dep = (DependencyObject)e.OriginalSource;
try
Infragistics.Windows.DataPresenter.DataRecordPresenter caca = Infragistics.Windows.Utilities.GetAncestorFromType(dep, typeof(Infragistics.Windows.DataPresenter.DataRecordPresenter), true) as Infragistics.Windows.DataPresenter.DataRecordPresenter;
//gets the row
Infragistics.Windows.DataPresenter.CellValuePresenter cell = Infragistics.Windows.Utilities.GetAncestorFromType(dep, typeof(Infragistics.Windows.DataPresenter.CellValuePresenter), true) as Infragistics.Windows.DataPresenter.CellValuePresenter;
// gets the cell, do whatever you want with it now
}
catch
Yes,
you can use our helper methods Infragistics.Windows.GetAncestorFromType/Name, Infragistics.Windows.GetDescendantFromType/Name.
The type would be CellValuePresenter, and the object you pass in as parent/child is the e.OriginalSource
yes, thank you, i managed to solve it.
i am now trying to retrieve the cell over which the mouse is on the previewmousemove event.
is it that simple as casting the e.originalsource to a cell type?
The problem is the way you set the style. You should set that style to the DataRecordPresenterStyle property of the FieldLayoutSettings object. If you do not set x:key value of the style, it will be applied automatically.
ok, so i tried that code:
<igDP:XamDataPresenter x:Name="dg">
<igDP:XamDataPresenter.Resources>
<Style x:Key="mama" TargetType="{x:Type igDP:DataRecordPresenter}">
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX="1" ScaleY="1"/>
</Setter.Value>
</Setter>
<EventSetter Event="MouseEnter" Handler="dp_MouseEnter"/>
<EventSetter Event="MouseLeave" Handler="dp_MouseLeave"/>
</Style>
</igDP:XamDataPresenter.Resources>
<igDP:XamDataPresenter.FieldLayoutSettings>
<igDP:FieldLayoutSettings RecordListControlStyle="{StaticResource mama}"/>
</igDP:XamDataPresenter.FieldLayoutSettings>
</igDP:XamDataPresenter>
but it does not work, the events will not trigger (They are written in my .cs file, no reason to post them here).
please tell me if I am doing something wrong as I am new in all this xaml.
Again, thanks a lot!