hello,
i would like to accomplish the following appearance of the xamDataGrid Row Label/Row Header/Recordselector however it's called:
- The Background should be always the same as the labels of the fields. If I change the theme of the xamdatagrid, the record label background should also change and have the same look as the field label.
- the recordselector should contain the number of the row (beginning with 1) (i.e. Record Index + 1)
- i want to set the borderthickness and the borderbrush, i.e.:
<Setter Property="BorderThickness" Value="0,0,1,1" /> <Setter Property="BorderBrush" Value="#D5D5D5" />
because my grid cells have the same borders.
the appearance should be a bit like the excel row header.
ist this possible? If yes, how?
Thank you very much for any help,
Jochen
Hello Jochen,
Thank you for your post. I have been looking into it and have created a small sample for you, named ExcelStyleRecordSelector. In the sample I create a style for the RecordSelector. To show the RecordSelector as numbers I set a text block, where I bind the text to the DataItemIndex and with a converter set the value from 1 to rows number. Please find the attached sample and feel free to let me know if you have any further questions.
I am just checking your progress on the issue. If you have any further question please do not hesitate to let me know.
Hi,
thanks, your example is really good!
I tried to create custom control. I want to use ist as a base class which contains basic settings.
Then i came across two more problems.
1. if i have a addnewrow the recordselector contains a cross "+" which works, but when i add a row, the new added row still contains this cross instead of updating the recordselector to the row number. I do not know how to accomplish this.
2. I tried to put the new RecordSelector Style in the "<Style.Resources>" area of the customDataGrid (in the generic.xaml). The numbers are shown but the background of the recordselector does not show the correct backround (not always: somtimes in some detached rows it works but i don't know why it behaves like this.)
I hope you can also help me with the new problems! Thank You!
I attached an example which shows these problems.
P.S.: If you have suggestions on how to realize such a base class which contains basic settings, please let me know!
Best regards,
I have been looking into your post. For your first requirement I have modified the sample you have sent. In it I have added an event setter. When the label is loaded I get its style and set it to the RecordSelector.
For your second requirement I can suggest to take a look at the following forum thread: http://ko.infragistics.com/community/forums/p/52722/278409.aspx. Please do not hesitate to let me know if you have any further questions on the mater.
I am glad that I was able to help you solve your issues. Please do not hesitate to contact us if you have any questions.
I was able to solve all problems with your examples/hints!
Thank you very much!
Sincerely,