Home Forums WPF controls Xceed DataGrid for WPF Why is this so?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #25040 |

    Let me start by saying that this is an excellent control and furthermore it admirable that xceed provide it for free. However….
    Why is it so hard to hook up common events such as row changed, cell changed, enter edit and end edit. These are the very basic events that are needed with a grid control. I have scaned a lot of the posts in here and the responses all seem to be in xaml. In fact the documentation provides samples in xaml.
    Without being pissy here… I use truegrid and it is an absolute breaze to work with… events are straight forward, data presentation is done in design mode etc. it just makes sense.
    I want to stay with xceed and a wpf grid, but i feel i may have to just put my good old truegrid on top of a formshost and be done with it.
    I have spent 3 hours scouring for a way to raise an event to notify me that the user has changed the state of a checkbox in a cell. Is this possible with code behind?

    Imported from legacy forums. Posted by David (had 877 views)

    User (Old forums)
    Post count: 23064

    use a style and a cell editor
    <xc:Column FieldName=”Tag” Title=”Tag” DisplayMemberBinding=”{Binding First, Mode=TwoWay}”>
    <CheckBox IsChecked=”{xc:CellEditorBinding}” Checked=”CheckBox_Checked”/>

    Imported from legacy forums. Posted by Colin (had 2344 views)

    User (Old forums)
    Post count: 23064

    I think the original poster asked the question I’m trying to find an answer to.  I can see how it is possible to write a cell editor and notification handler for every possible cell, as Colin describes above.  Is the implication, then, that there is no way to simply find out when a row has been edited without manually specifying change events for every possible cell?  For example, when the user has edited a row I want to:

    – Provide some visual indication (i.e., put an “*” in the title bar of the window to indicate the data in the window is dirty).

    – Enable/Display Save and Cancel buttons for the overall grid.

    I can think of various ways to find out when data has changed if I want to go around hooking up events manually.  For example, I could either approach it using Colin’s method (capture change events on the underlying WPF controls) or I could make sure the data being bound supports change notification and subscribe to notification events on every data object in the grid (which seems unnecessarily intrusive).  Are those my only options, or is there some other change notification mechanism in the DataGrid that I’m not seeing?



    Imported from legacy forums. Posted by David (had 250 views)

    User (Old forums)
    Post count: 23064

    I did find something that gets me partway there, at least.  I can hook the DataGridControl.IsBeingEdited dependency property (using the DependencyPropertyDescriptor::AddValueChanged approach).  I can watch for the transition of that property from True -> False.  That obviously doesn’t tell me, though, whether the underlying data was actually changed.  I can add some sort of “Dirty” bit to the underlying data object if I have to, but obviously it would be much easier to simply find out from the DataGrid at least whether the user committed or canceled the edit of the cell they were in. 


    Imported from legacy forums. Posted by David (had 1357 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.