Welcome to the Xceed Community | Help
Community Search  

DataGrid for WPF FAQ - Read me before posting

Sort Posts: Previous Next
  •  04-12-2007, 10:30 AM Post no. 7650

    DataGrid for WPF FAQ - Read me before posting

    Documentation search added:

    If you go to the online documentation, you can now easily search for information.

    Here are the most frequently asked questions on the forums. Should you not find an answer to your question here, please feel free to post a new thread. You may also search the forums, there are a lot of answers.

    FAQ:

    1. How do I unlock Xceed DataGrid for WPF?

    You can refer to this thread.

    2. How do I bind the datagrid to an XML source?

    Note: You can also use the custom XmlDataGridItemProperty and XmlPropertyDescriptor classes available here.

    The main thing to know about this is that the "AutoCreateColumns" feature of the DataGridControl will not work when using a XML data source, therefore you should set this property to "false" on the DataGridControl. Then, all you need to do is to manually create your columns and use a "DisplayMemberBinding" that specifies a "XPath" instead of a "Path

    3. How can I set a different view and theme to my datagrid?

    You can achieve this by setting a View on your datagrid control.

    4. How do I provide a custom template to a datagrid Element?

    You will find more information on how to provide custom templates for the datagrid here.

    5. How do I hide the GroupByControl from the datagrid in tableview?

    You can refer to the following thread.

    6. How do I remove the rowSelector from the datagrid in tableview?

    This is documented here.

    7. What happened to ActualContent?

    The ActualContent property was an internal property.  Although binding to it in XAML worked (as long as the application has full trust), it was only a temporary workaround.

    It was one of our goals for version 3.0 to get rid of ActualContent and to make it so that the Cell's Content property was always "live" with the business object. From now on, the Cell's Content property will always return the current content of the cell.  

    Let's take the following scenario:  

    If a business object's "quantity" property is set to 10 and you enter edit on a DataGridControl's DataRow to change the "quantity" cell to 20:

    In version 2.0, the Cell's Content property would still be set to 10 and the internal ActualContent property would be set to 20. With version 3.0, the Cell's Content would now be equal to 20, even if the cell and/or the row is still in edit mode.  The business object's "quantity" property will still be equal to 10 until the binding between the cell's Content property and the business object is updated.  

    The moment when this binding updates the source is controlled via the DataGridControl's UpdateSourceTrigger property. Its default value is RowEndingEdit, meaning that each of the row's cells Content will be sequentially pushed to the business object as soon as the row tries to end its edit process.

    The other UpdateSourceTriggers are :

    CellEndingEdit, which means that the cell will push its content to the source as soon as it tries to end its edit process, even if the row is still being edited.

    CellContentChanged, which means that the cell will push its content to the source as soon as its Content property changes... this could very well mean that it could update your business object at each key stroke made in a cell editor.

    Therefore, as of version 3.0, all bindings to the "ActualContent" property must be changed to the "Content" property instead.


    Mathieu Drimonakos
    -Technical Designer-
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.