Hi There,
first i want to explain to you what i want, than how i solved it and finally what my problem is.
I was looking for a SelectionChangedEvent on a GridViewComboBoxColumn because based on the selection i have to calculate another property of my "RowItem".
e.g. A user change the value in my first column ( a GridViewComboBoxColumn ), so the value in column no 3 has to be calculated.
Because i didn't find an event, which i can use.
I created my own column, it work mostly:
My problem is now that i am unable to get the row item in my gridview to set the property for the third column.
Can somebody helps me by this issue? Or is it the wrong why to solve this problem?
Many thanks in advance for your cooperation
first i want to explain to you what i want, than how i solved it and finally what my problem is.
I was looking for a SelectionChangedEvent on a GridViewComboBoxColumn because based on the selection i have to calculate another property of my "RowItem".
e.g. A user change the value in my first column ( a GridViewComboBoxColumn ), so the value in column no 3 has to be calculated.
Because i didn't find an event, which i can use.
I created my own column, it work mostly:
public
class
ComboBoxColumn : GridViewBoundColumnBase
{
######################shorted##############################
public
event
SelectionChangedEventHandler SelectionChanged;
private
void
OnSelectionChanged(
object
sender, SelectionChangedEventArgs e )
{
var myEvent =
this
.SelectionChanged;
if
( myEvent !=
null
)
{
myEvent(
this
,
e );
}
}
private
void
ComboBoxSelectionChanged(
object
sender, SelectionChangedEventArgs e )
{
this
.OnSelectionChanged( sender,e );
}
######################shorted##############################
public
override
FrameworkElement CreateCellEditElement( GridViewCell cell,
object
dataItem )
{
this
.BindingTarget = RadComboBox.SelectedValueProperty;
var comboBox =
new
RadComboBox
{
ItemsSource =
this
.ItemsSource,
DisplayMemberPath =
this
.DisplayMemberPath,
SelectedValuePath =
this
.SelectedValuePath
};
comboBox.SelectionChanged +=
this
.ComboBoxSelectionChanged;
comboBox.SetBinding(
this
.BindingTarget,
this
.CreateValueBinding( ) );
return
comboBox;
}
My problem is now that i am unable to get the row item in my gridview to set the property for the third column.
Can somebody helps me by this issue? Or is it the wrong why to solve this problem?
Many thanks in advance for your cooperation