Hi,
we are making use of xamDatagrid. Its data source is bound to a collection. And field layput is set at runtime and bund as well.
One field is dropdown type. We want to enable/disable some other columns depending on the value set in the dropdown.
We also need to change the columns IsEnabled property, if the value of dropdown column is chnaged at runtime.
Referring the screenshot attached, depending on the selection in "Regress" column, the "Min", "Max" and "Fixed" columns will be enabled or disabled.
please guide as early as possible.
Thanks in advance,
tejmestri
Hello,
I am just checking your progress on the issue.
If you require any further assistance please do not hesitate to ask .
Sincerely,
Ekaterina
Developer Support Engineer
Infragistics
www.infragistics.com/support
Hi Ekaterina,
I appreciate your prompt reply.
we have made a UserControl which consumes xamDataGrid.
Same control can be added dynamically on multiple views in our project by setting appropriate FieldLayout and DataSource.
"To disable cells only if they were clicked previously on Selection change of combobox" is an undesired behavior. When tested code sample given by you, it is working properly.
Only diff is we have license for NET advantage 10.3 and in your project you have referred 11.2 DLLs.
I have attached view, viewmodel and code behind files for the grid user control.
In the attached bmp you can see that, even though "Fixed" is selected in combobox and code executes for disabling 3 columns, in the UI, these columns are still shown enabled. They will get disabled only if these columns are clicked previously,
Thanks & Regards,
Tejaswini
Thank you for your answer.
I did not quite understand if you would like to disable cells only if they were clicked previously, or this is an undesired behavior that occurs in your application.
If you would like to have this implementation you can handle the cellValuePresenter’s click event using style:
<Style TargetType="{x:Type igDP:CellValuePresenter}">
<EventSetter …
Thank you can mark the cell as clicked via some sort of collection that hold information on the CellValuePresenter’s Field.Index. Than using my sample, you can disable the needed cells.
In case this is an undesired behavior it would be helpful if you send me a sample project in order to illustrate it, because I am not able to reproduce it using my code.
I will be looking forward to hearing from you.
Infragistics, Inc.
Thanks for your reply.
I need to enable/disable a particular field is the selected record depending on value selected in combobox.
I implemented your solution in the code-behind. (finally we need to implement it using MVVM).
Its disabling the desired cells, depending on the value selected in combobox, only if the cells to be disabled are clicked previously. Otherwise there is no change, whatever value user selects in the combobox.
(FYI: we are using Infragistics .NET Advantage 10.3 for WPF)
Any further help is appreciated.
Thanks,
I have been looking into your scenario and I have created a sample project that demonstrates a possible custom approach of achieving the desired behavior. When you run the application you will see that via a xamComboEditor you can choose either to disable single cell or the whole field at once. Please notice that the Field object that represents the columns in xamDataGrid do not expose an IsEnabled property, so in order to disable the whole column I am looping through the records collection, disabling every single cell.
Please let me know if my sample meets your requirements or I have misunderstood you at some point.