Hello,
I want to bind my Custom property to IsEnabled property of DataRecord of xamDataGrd.
Is there any way to do this? Can I do it using Style or something?
Thanks & Regards,
Abdi
Hello Abdeali,
I am glad your solution is working now.
Please let me know if you have any more questions.
Sincerely, ZhivkoEntry Level Software Developer
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Record.DataItem.ReverseTransactionID, Converter={StaticResource NumericToBoolConverterKey}}" Value="False" > <Setter Property="IsEnabled" Value="False"/> </DataTrigger>
Hi Zhivko,
In my case Converter did the job!
Thanks for your inputs :)
Thanks Zhivko for your suggestion.
It works perfectly fine in the sample application i created. But is not working where i want it to be!
The thing is that, in sample application i am directly using XamDataGrid. Under this i have all my resources, field layouts, etc...
Now in my real application i am using a CustomGrid which is being created by inheriting XamDataGrid. So it's my assumption that RelativeSource is something which is not proper in my case.
Any suggestion would be helpful.
Thanks,
You can try to specify the RelativeSource in the Binding that you are using and also change the expected value in the DataTrigger, for example:
<Style TargetType="{x:Type igWPF:DataRecordPresenter}"> <Setter Property="IsEnabled" Value="False"/> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Record.DataItem.ReReversedTransactionID}" Value="null" > <Setter Property="IsEnabled" Value="True"/> </DataTrigger> </Style.Triggers></Style>
Please let me know if you require any further assistance regarding this matter.