We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfDataGrid, dynamic changes on cells and columns

I have a SfDataGrid bound to a collection.

Depending a dropdown selection i bind the grid to other collections  with differents colums and value types. Collections format is only known at run time. Cells values are updated once per second.

This part is almost running. I just need to make some cosmetic actions, such as changing display format or changing background cells color when values are updated inside.

 Actually i'm not using any templates, but I just create columns when discovering the binded collection.

 for (int i = 0; i < data.Count; i++)

{

   GridTextColumn c = new GridTextColumn();

   c.MappingName = string.Format("[{0}]", i);

   c.HeaderText = columnNames[i];

   activeColumns.Add(c);

}

 

Thanks in advance for any help.

 

 

 


2 Replies

PS Prakash Selvaraj Syncfusion Team April 8, 2013 10:35 AM UTC

Hi Thimonnier,

 

Thank you for choosing Syncfusion Products.

 

We have analysed your query, you can achieve your requirements by defining the DataTemplate in GridTemplateColumn. We have prepared a simple sample based on your requirements. In that sample we have used one attached property and storyboard within the data template to highlight the value when it is dynamically changed. Kindly refer the below sample.

 

Sample Location: SfDataGrid.zip

 

Please let us know if you need further assistance.

 

Regards,

Prakash S.



AK akhor April 28, 2014 09:22 PM UTC

Prakash, could you, please, attach this sample again? I cannot to download it.

Loader.
Live Chat Icon For mobile
Up arrow icon