Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2395
Is there a way to determine row location?
posted

Hi,

 

I want to style cells differently if they are in the last row of the grid.

I partially achieved it using converter using the following code:

 

public object Convert(object value, Type targetType, object parameter, CultureInfo culture)

{

DataRecord record = value as DataRecord;

if (record == null)

return false;

return record.VisibleIndex == record.ParentCollection.Count - 1;

}

But after sorting the grid it does not work.

Id there any way to determine that DataRecord is in the last row?

Thanks.

 

Parents
  • 138253
    Offline posted

    Hello Dierk,

     

    Thank you for your post. I have been looking into you requirement and I created a sample project for you with the functionality you want. Basically I created a Style for the DataRecordCellArea and with a Converter a determine the last record and set its Background. Also I set the XamDataGrid’s RecordContainerGenerationMode to Virtualize, so that the DataTrigger could works correctly. Please let me know if this helps you or you need further assistance on this matter.

     

    Looking forward for your reply.

    XamDataGridLastRecord.zip
Reply Children