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
|
Hi, I was wondering, with data grids, if an item is changed, will this cause the whole grid to update or will one cell be changed? Thanks in advance, Andy |
|
|
Hello Andy If a property on a row model object is changed, then only the cell that binds to that property on that row will be updated. The only exception to this is if the column of that cell is set to auto-width, then the data grid will be remeasured to potentially adjust the width of that column. -Jason Fauchelle |
|
|
Thanks Jason. |
|
|
Jason, Do you happen to have or have plans for adding window docking and layout managing capabilities to your WPF element suite? Andy |
|
|
Hello Andy We had plans for a docking manager, and I had even started building it, but it became clear that it was going to take a lot longer to build than we had thought and so put the project on hold. When work on my current projects quieten down, and if there is enough demand for docking, we may continue working on this. In the mean time, you can vote on this: http://www.mindscapehq.com/thinktank/suggestion/377137 -Jason Fauchelle |
|
|
Thanks, I've voted for it. I'm trying to setup a grid and have some questions on how to get it to do what I want. The questions are,
Thanks again, Andy |
|
|
Hello Andy
Let me know if you have further questions about these. -Jason Fauchelle |
|
|
Hi Jason, Thanks again for the help. I was able to do try a few and got them to work. As for the 3rd question its not exactly what I was looking for. I have a system that will be executing a series of steps and sub steps. So as things are being executed, I need a "marker"' of some kind to indicate its on a particular row. One way was to highlight the row but if the user can click on something else, there is no more indicator. Do you have something build in to put an indicator on the "row header" for this purpose? Also I'm trying to update data when events occur and the data isn't updating unless the user constantly move the mouse over the row. I might be doing something wrong but An example would be as follows.
Thanks again, Andy |
|
|
Hello Andy Thanks for the clarification on number 3. This is not a built in feature, but we do provide a way to display content in the row headers. This can be done by setting the RowHeaderTemplate property of the DataGrid. You could create a template that binds to a property that specifies which row you want to be highlighted. The best way to do this would probably be with an attached property that you set on the DataGrid. The binding in the template would need to be a multi-binding which also binds to the row object that the header is on. Then the converter of the multi binding would compare the two values to determine whether or not the indicator should be displayed. Both parts of the binding would need to have AncestorType relative sources to find the binding sources. A simple example of custom data grid row headers can be seen in the Sample Explorer project that comes with WPF Elements - that will be a good place to start. As for the new issue, make sure that the properties that you're binding to in your model are raising property changed notifications. Let me know if you have questions about these. -Jason Fauchelle |
|
|
Thanks again Jason, I'll try out the template when I get to it. As for the cells not updating, you were right, the property was not firing and so I fixed it by calling a fire event. But I also notice that for cell where i used "DisplayTemplateSelector" , even with the event being fired, the cell does not update. I was able to reproduce it on the Cell Template Selector Demo by adding the following lines of code in the DataGridCellTemplateSelectorDemo.xaml.cs file. Could you take a look at this when you get a chance please? Thanks again, Andy
|
|
|
Hello Andy The reason for this is that the TemplateSelector is applied to the whole row object (such as the Person object). This makes the TemplateSelector flexible in regards to what logic you can write, but this was not a good idea regarding dynamic model updates - because it can't listen to any property change notifications. Unfortunately we can not do much about this right now. If possible, try to avoid using TemplateSelector and use a single Template that uses converters or triggers to change the look. This should allow you to do exactly the same thing as what a TemplateSelector allows you to do, except that you can only check the one property, not the whole row model object. I hope this works well for you, let me know if you have any questions. -Jason Fauchelle |
|
|
Thanks Jason that worked for me. I was playing with the gird and ran into an odd behavior where setting the Width of a column will prevent the user from making the column larger and when re-sizing it smaller will cause the system to throw the Exception {"'Infinity' is not a valid value for property 'Width'."} . I was able to reproduce the same crash with the SampleExplorer.DataGridRowHeaderTemplateDemo by setting the ElementType Witdth to "*" and resizing the width. Could you look into this when you get a chance? Also, is there a way to disable the property grid but still allow the user to view and and click around in the property grid? Thanks, Andy |
|
|
Hello Andy Thanks for pointing out the issues with star-sizing columns. This will be resolved in the next nightly build. Unfortunately there currently isn't a readonly mode on the property grid. This would require quite a bit of work and it will be a while before we implement this. If you like, you could post this as a suggestion in the feature requests forum: http://www.mindscapehq.com/thinktank/product/15 -Jason Fauchelle |
|
|
Thanks Jason. Is there a workaround for the readonly mode? I also notice an issue with data grid and allowing user to add new rows. In the example (and also my own app), there are x number of empty rows at the end to allow user to add data to. If the user add x number of new rows, all the items before the last that was added will be deleted. So in the demo, there's 2 empty items. If you put 1 for the title for the first row, then put 2 in the 2nd empty row, the first row is now gone. If there 5 empty rows, when the user start entering the 5th item, all 4 of the previous items will be deleted, etc. Also, for data grid, is there a way to allow the user to re-order rows of data and preserve its order when I go and read the data from the observable collection? For example. lets say I have 10 rows. The user want to move row 5 to row 1. When i go pull the data from in code, i want it to be in the new order. Thanks again, Andy |
|
|
Hello Andy There is a workaround for readonly mode, but that will no longer be necessary. The next nightly build will include an IsReadOnly property on the PropertyGrid. This will affect all of the built in controls. If you are using any custom template that contain editors in them, you may want to bind their IsEnabled or IsReadOnly (Or Visibility of buttons) properties to the IsReadOnly property of the PropertyGrid so that they can respect this option. Let me know if you have questions about this. Thanks for pointing out the issue with the user-row feature. There is only ever supposed to be one empty row added by the DataGrid at one time. This will be resolved in the next nightly build. Currently there is no UI for re-ordering rows in the DataGrid. The only way to do this would be to create your own UI controls (Either as part of the DataGrid, or sitting somewhere in your application) to do this which then manipulates the order of the items within the ObservableCollection items source. -Jason Fauchelle |
|
|
Thanks Jason. I have a request, could you break up the dll into smaller DLLs? I'm working with a customer want to limit the size of the application and having almost 4 megs for a little troubling. THanks, Andy |
|
|
Hello Andy Thanks for the suggestion. I've added this to our backlog, but it will likely be quite a while before we can do this. We'd most likely do this in a major release. -Jason Fauchelle |
|