开发者

Issue in parsing the GridViewRows in a Telerik RadGridView

开发者 https://www.devze.com 2022-12-28 22:11 出处:网络
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

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开发者_StackOverflow中文版 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();
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号