We have a scenario where we will have to execute stored procedures and display the data on xamgrid. Some of the stored procedure return upto 50K records and therefore we would like to display them using virtual collection. However, we also have a scenario where the output of the stored procedures can change at times(may return new set of columns) based on the business requirement. We would not like to change the model everytime that happens hence we return a standard type of IEnumerable<Dictionary<string, object>>. Please let me know if its still feasible to use virtual collection under the given constraints.
Hi,
Here the answers of your questions
A1:There is a property you could use to customize the strings displayed. You could add this line in the for cycle where the columns are being initialized:
newColumn.FilterColumnSettings.FilterMenuClearFiltersString = "Clear Filters for " + p.Name;
A2: I assume that you want to set the FontWeight for all grid cells (i got a bit confused looking at the sample - do you want to style only the summery cells?!) - so you could do this defining your style:
<Style x:Key="BoldenCellStyle" TargetType="ig:CellControl"> <Setter Property="FontWeight" Value="ExtraBold"></Setter> </Style> and then feeding it to the xamGrid's CellStyle property:<ig:XamGrid x:Name="igGrid" AutoGenerateColumns="False" CellStyle="{StaticResource BoldenCellStyle}">
A3:You are able to add a custom operands to the filter menu. However there might have some kind of issue with the filtering through Filter menu. I will investigate the issue asap and try to answer Q3 in more complete manner.
P.S. I have attached the updated sample solution illustrating the A1 and A2.
HTH
Hi Konstantin,
Thanks for your reply. I have seen your sample. But my problem is actually diffrent.
My Issues are
1) In Column Filter window , Clear text will be shown as Cllear Filter for 'Properties[FN].Value' instead of Cllear Filter for 'FN' .I know this is because the way i have binded the data. please let me know any way i can resolve this. but my datasource will be same collection.
2) I am applying FontWeight property to XamGrid Cell. The FontWeight property is not applied to the column but rest of the other properties are applied. Please Let me know how to apply the FontWeight Property.
3) In my sample when you apply Custom Filter on AGe column you will find only 2 operands. but i want to add all integer operands to the drop down.please provide me the solution.
I have attached the modified the sample and updated with screenshot.
A1: you do not need to hard code the keys you could iterate over the property names in a File and create a column based on the PropertyName
A2: setting AllowConditionalFormatin="True" only enables the conditional formatting. You need to specify the ConditionalFormating rules for each column you are creating.
I have updated your sample with a sample CF rule which is applied if the the Value is int. You could specify the conditional formatting rule that best suits your scenario for every type you want similarly to the one I did for int. For more details about the how the conditional formatting works check out this help article.
About using the Virtual Collection(if this is what you mean by Virtualization) you will need to refactor your service so you could request a certain range of items. For more details about the Virtual Collection you could check the help articles or take a look at the VC samples.
Let me know if you have any further questions.
Regards,
Thanks for your quick replay.
I have seen your sample but i have few more Queries.
First i will mention follwoing things.
1) In my case columns are dynamic. so i cant hard code the columns.
2) When i add columns dynamically to the grid conditional formatting is not working. because i feel TextColumn
taking the datatype as object.
Actually i have created one sample. but in that i have not implemented the Virtualization because i didnt get time.
if possible update the same solution for Virtualization and conditional formatting should work for int , decimal kind of columns..
you should most probably use VirtualCollection<<Dictionary<string, object>>>.
I am attaching the updated sample which uses the VC as item source. I have also repaired the link.