Hi,
I am trying to have a record seprator in my data grid which only seprator a set of records similar in record fixing but I dont want to fix my records while scrolling. I only want to have a seprator which distinguish my set of records for example I have 10 records I want to separate my records with a line 3 records in a set and a seprator 5 records then seprator 2 records and a seprator.
1
2
3
--------------------
4
5
6
7
8
----------
9
10
Any help ill be appriciated .
Thanks.
Hello,
One way would be to create a top or bottom border of the data record presenter that you wish to separate. You can also add a margin or event retemplate the DataRecordpresenter. In order to make this conditionally funtional, you can use IValueConverter and apply this border to only specific DataRecordPresenters
Hi Alex,
Thanks for your suggesting solution to my probplem. I did in the same way but now I am getting some abnormal behaviour some times but not frequently. The problem is that on my datatrigger as code given bellow its working fine but at times the border appear againt some other record instead of the place I am trying to disply. This problem apears at times not every time when grid has scroll bar and while scrolling. I think it could be redrawing isse. But can you please suggest a proper solution in this regard.
It could be that some record presenters are recycled and the borders are not removed. Have you tried changing the RecordContainerGenerationMode property - for example to Virtualize. This is a more aggressive virtualization mode.
Thanks for reply, Well I am doing in the same way defining my datarecordpresenterstyle in xamdatagrid resources. But still the problem of relocation of fields persists. please add checkbox and slider control in your grid and dock from dockpanel and resize the widths of fields and then undock the grid back to dockpanel you ill find the error I am refering to.
Thanks
Where have you defined the DataRecordPresenter style? It could be that when you undock the content pane the style is lost because the XDG will be placed in a floating content pane, which uses a different visual tree. I am attaching a sample project with this - try moving the style from the XDG's resources to the Window's or Grid's resources.
I would also suggest not to change the template with the trigger. Probably it would be better if you change a single property with a trigger instead of changing the whole template. You can see this covered in the sample as well.
Thanks for reply. Well Alex I cant provide the similar code sample because of shortage of time but I am sending you a screen shot of my grid. And I belive problem is because of DataRecord Presenter defined for the border given above. My grid's Autofit Mode is Default. this problem of relocation of column aries on all autofit options.
Can you provide us with a sample project that reproduces this and we will look into it?
Thanks for reply, yes it seems that its working, But I notice another problem in my datagrid I am composing different controls like checkbox and slider controls in each row. and this grid is hosted in a pane of xamdocmanager. I dont know when i undock this grid from dockmanager its both column change their position. Initially both are in start but while undocking my grid both goes to the end. Can you please also suggest wot could be the problem and its solution thanks.