Hi i am using v9.2 and inside xamDataGrid i want to the following:
Each of my data grid row represents an actual media file (1.mp3, 2.mp3 etc). Each column represents a property of that media file (name, media length, created date etc.), I also have an extra column at the end of the grid in which there's a "play" button embedded.
Now Say we have 3 columns, when the user click on the "Play" button, i want to have a progress bar starting from leftmost column one progress to the rightmost of column three before it ends playing.
Is there an easy way to do this in xamDataGrid? One of my co-worker has shown me the progress bar progressing within one single column so i know it's possible there.
Any suggestion or comment is appreciated.
James
Hello James,
Yes this is possible. However, you would have to place the Progressbar in the DataRecordCellArea element. This is the area that holds all of the cells. As the progressbar is a visual element and the cells also, you would have to set the Panel.ZIndex in the control template of the DataRecordCellArea. You would probably need the cells to be over the progress bar.
You can access the progressbar by walking up/down the element tree. For example, in the button click you would have the following code :
ProgressBar progress = Infragistics.Windows.Utilities.GetDescendantFromType(DataRecordPresenter.FromRecord((sender as Button).DataContext as DataRecord), typeof(ProgressBar), true) as ProgressBar;
Another idea is to animate the background of the DatarecordcellArea with an animation. You can make it look like a progressbar by setting the StartPoint and EndPoint properties of the LinearGradientBrush and animate the Offset property of the GradientStop.
Thanks for the reply. I looked at the style you provided but i don't quite understand it. Do you have a working example or is there a tutorial on this?
regarding on animate the background of the DatarecordcellArea with an animation, do you have a working code snippet? thanks.