This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I cannot seem to get the AllowUsersToAddRows property working on my DataGrid (using the nightly from 12/11). Does this feature not work if the underlying ItemsSource has an internal or private constructor (which is the case in my data)? Also, are there plans to include the ability to delete rows (or does it exist now and I just missed it)? Thanks for the help, the datagrid is MUCH nicer looking than the built-in WPF one, but I can't get a few of these basic things working. |
|
|
Hello Adam Yes, the items added to the DataGrid will need a public default constructor for the DataGrid to build instances of them. Are you able to make a public constructor for now? We have plans to include a way to specify how to build objects with private/internal constructors etc in a future release. Currently there isn't a UI feature to delete rows, but this is certainly a feature we will be adding in a future release. I've increased the priority of this feature for you. Jason Fauchelle |
|
|
Thanks for the reply. I am not able to add a public constructor, it's generated code that can't really be modified. Thanks for the update on deleting as well, I'm looking forward to that capability. |
|
|
Did this get addressed? Is there a was to add a new item to the datagrid source collection if the item does not have a default constructor? |
|
|
Follow up question as well. How do I control which columns can be tabbed to in edit mode? I have tried a few things like KeyboardNavigation, etc but doesn't appear to have an effect on the tabbing. |
|
|
Assuming this needs to be done by some kind of styling of the DataGridColumn or DataTemplate, but not having any luck. Can anyone reply with a simple example of styling a DataGridColumn to set KeyboardNavigation.IsTabStop to false on all items in a column? |
|
|
Hello For building objects that do not have public constructors, I have implemented a solution to this just now. This will be available in the next nightly build at around 1200 GMT (about 8 hours from now). Nightly builds can be downloaded from here: http://www.mindscapehq.com/products/wpfelements/nightly-builds Once you've installed the next nightly build, you'll find there is a new interface: IObjectBuilder. Create a new class that implements the single method of this interface. From this method you can return a new object that will be the data context of a data-grid row. Since this is in your own project, you'll be able to build objects that have internal/private constructors, or that don't have default constructors. Next, set the DataGrid.ObjectBuilder property to be an instance of your custom object builder class. Now the AllowUserToAddRows = true feature will work as expected. Let me know if you have any questions about this. I've answered your tab-stop question here: http://www.mindscapehq.com/forums/thread/1237039 Jason Fauchelle |
|
|
OK, will give this a try. |
|