解析 Telerik RadGridView 中的 GridViewRows 时出现问题
我想做一些类似于我们在 ASP.NET 中所做的事情,我们解析 GridView 中的所有行,并将特定值分配给行中具有匹配 TaskId 作为当前 Id 的特定单元格。
这必须发生在 Dispatcher Timer 对象的 Tick 函数中。因为我在 GridView 中的每一行都有一个“开始计时器”按钮“列”。单击特定行的“开始计时器”按钮后,我必须启动其计时器并显示在该行的单元格中。同样,可以有多个并行运行的计时器。
为此,我需要能够检查特定任务的任务 ID,并在所有已启动计时器的任务中使用更新时间不断更新单元格值。
TimeSpan TimeRemaining = 某个值; 字符串当前任务 ID = "100"; foreach(GridViewRow row in RadGridView1.Rows) // 这里我也尝试了 RadGridView1.ChildrenOfType() 但它有 null { if( (row.DataContext 作为任务).TaskId == CurrentTaskId ) row.Cells[2].Content = a.TaskTimeRemaining.ToString(); 有人
可以告诉我如何使用 Telerik RadGridView 获得此功能吗?
干杯, 赛义德.
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这对我有用 - 使用 Telrik WinControls Q2 2009。我在计时器的滴答事件中有这个。
this works for me - using Telrik WinControls Q2 2009. I have this in the tick event of a timer.