문제

I would like to do something similar what we do in ASP.NET where we parse through all the rows in a GridView and assign a particular value to a particular cell in a row which has a matching TaskId as the current Id.

This has to happen in a Tick function of a Dispatcher Timer object. Since I have a Start Timer button Column for every row in a GridView. Upon a particular row's Start Timer Button click, I have to start its timer and display in a cell in that row. Similarly there can be multiple timers running in parallel.

For this I need to be able to check the task Id of the particular task and keep updating the cell values with the updated time in all of the tasks that have a Timer Started.

TimeSpan TimeRemaining = somevalue; string CurrentTaskId = "100"; foreach(GridViewRow row in RadGridView1.Rows) // Here I tried RadGridView1.ChildrenOfType() as well but it has null { if( (row.DataContext as Task).TaskId == CurrentTaskId ) row.Cells[2].Content = a.TaskTimeRemaining.ToString(); }

Can someone please let me know how do I get this functionality using the Telerik RadGridView?

Cheers, Syed.

도움이 되었습니까?

해결책

this works for me - using Telrik WinControls Q2 2009. I have this in the tick event of a timer.

foreach (GridViewRowInfo row in this.radGridView1.MasterGridViewTemplate.Rows)
{
    if (row.Cells["colId"].Value.ToString() == CurrentTaskId)
    {
        row.Cells["colTimerValue"].Value = a.TaskTimeRemaining.ToString();
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top