Hello everyone,
I am trying to implement HighlightAlternateRecords when I export my xamdatagrid to excel.
So in the code I need to reach the number of columns to set color of each cell in excel. I can reach the row number with tempGrid.Records.Count but I can not figure out how can I reach the column numbers
Thanks
Hello,
Thank you for your post. I have been looking into it and I can say that the nested data has a different FieldLayout and if you use the xamDataGrid.FieldLayouts[0].Fields.Count you will get the Fields from the first level. Please let me know if this helps or if you need further assistance it will be great if yo usend us an isolated sample project, where your issue is reproduced, so we could investigate it further for you.
Looking forward for your reply.
Hello.
I also wan't to count the columns. My Problem is the NestedData. They also count as column. When the Property is IsNestedDataDisplayEnabled is set to false, they will not be displayed but the visibility is just visible.
How to count just the "normal" fields without the nested?
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.
Stefan I calculated the number of visible columns with a for loop. Problem solved
Thanks your help
thanks Stefan it works. One more question. My xamdatagrid has 17 columns but default at the screen I show just the 12 columns. So when I use tempGrid.FieldLayouts[0].Fields.Count it gives 17. How can I reach to the 12 number(Number of columns that shown in the screen)