Some of my cells must be Disabled
GridViewRow row = (GridViewRow)this.grid.ItemContainerGenerator.ContainerFromItem(item);
grid.Cells[2].IsEnabled = false;
But when I check the value of the property "Cell.IsEnable", it stays to True.
The State of my cell is not maintained...
How can I maintained it ?
Regards,
S
7 Answers, 1 is accepted
It will be better to use StyleSelectors since the grid is UI virtual component and containers like cells, rows, etc. will be recycled during scrolling, sorting, etc.
All the best,Vlad
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

How can I handle this with a StyleSelector ?
Thanks,
PS : If you post a sample, please no .zip. I am not allowed to open thus files.
Have you checked the demo I've posted? You can check also our documentation and local version of the demos as well.
All the best,Vlad
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

But the style selector does not depend on another cell.
You have access to the data item itself and you can check any property.
Greetings,Vlad
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

In fact, when I click on cell which should be Disabled, the first cell of the row is selected.
I need to remove this selection because the user should not be able to click on a disabled cell...
I tried to cancel the CurrentCellChanged but the newCell.IsEnable stays at true...
Regards,
S
The behavior of the disabled cells that you have described is actually by design. When you have a disabled cell, then the UI hits it as not visible, so it does not receive the mouse events - it cannot be selected, it cannot be clicked. This causes that the underlying row receives the click. You will get the same if you click on the end of a row, where you have an empty space after the columns(cells).
When the row is clicked, then the first cell of the row is focused by default. The CurrentCellChanged event is fired by the focusing of the first cell of the row(as the row receives the click), not by selecting the Disabled cell.
Nevertheless, your point is reasonable, so we will discuss this case for eventual future improvements.
Didie
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!