I have to develop some custom Columns for the XamGrid and therefore read the doc and this article http://es.infragistics.com/community/blogs/devin_rader/archive/2010/07/08/creating-custom-columns-for-xamgrid.aspx
i've developed some Columns and added them to the Grid. It worked just fine. But when I add a new Item to the ItemSource from codebehind, the Controls in my custom column moves on to the next row.
I attached a project with a little sample. Maybe i shouldnt return only one control as Editor and Display element? If thats the case could you explain a Little further how to develop editable columns. They should be editable the whole time.
regards and thanks
Hello,
Thank you for your post. I have been looking into it and the sample you have sent us and I modified it, so now it works as you want. Basically I returned the same TextBox in the ResolveEditorControl method, which is the control that appear when you enter in edit mode. Please let me know if this helps you or you have further questions on this matter.
Looking forward for your reply.
Thanks for your answer. Unfortunately I have two new problems. Maybe I don't get your concept behind the columns. I've attached the solution:
1. I've added a second button so I can delete Items (I can't use the grid-functionality for several reasons). So now you can select multiple rows and with a click on the button they will be deleted. When I delete all rows at once and add a new Item the custom column will show data of a deleted row. Why is that?
2. I've added a enabled-functionality, which works just fine on the first row. When I add a new row the custom column will be enabled right from the start. I've noticed that while adding a new row the property "_isInitialized" is already on true. So the ContentProvider is the same as in the first row? Also the Binding of the second row seems to bind on the data of the first row (Add multiple rows without changing the enabled-flag -> setting enable-flag on first row will change the flag on another row).
I thought virtualization is the problem. But i subscribed to "CellControlAttached" and set the Dirty-Flag to true. No change in behaviour.
regards.
I have been looking into the sample and I modified it, so now it works as you want. Basically for the first issue, I removed the Source of the Binding for the display element, because when you remove the items from the data source the source remains and this is way the old values are shown. For the second issue I created a Binding for the IsEnabled property of the Editor, and used the Enabled value. This way the enabling and disabling works as expected. Please let me know if this helps you or you need further assistance on this matter.
thx. worked fine.
Hello Vishal,
Thank you for your post. I have been looking into and I created a sample project for you with the functionality you want. Basically I handled the XamGrid’s Loaded event and in the handler I fix one of the columns. I also handled the XamGrid’s ColumnFixedStateChanging event and canceled it if the new state is unfixing. Please let me know if this helps you or you have further questions on this matter.
Hi,I had a requirement with XamGrid with fixing first column on left and rest other columns are configurable and Disable the possibility to drag and drop for this column and Prevent other columns to be draged and droped on the left of this column.
Thanks
Hi Stefan,
I need to create a XamGrid with configurable columns. But the first column on the left should always be displayed on the left and never be moved from there.
- I need to disable the possibility to drag and drop this column.
- I need to prevent some other columns to be draged and droped on the left of this column.
do you have suggestions?
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.