我正面临在基础设施超网络网格中对超链接列进行排序的问题。我正在使用服务器端排序方法对列进行排序 -GD1_sortcolumn
并传递 asc、desc 和其他参数相应地绑定超 webgrid 中的数据,它在这里工作正常,排序也适用于 Name 列。例如,我已经传递了 Name 列和 asc 参数,然后它使用这些参数调用 sp。我得到了带有排序值的数据表,并成功地将数据表与网格绑定。
问题出现在GD1_InitializeRow
创建超链接时的方法中。请找到以下代码:
private void GD1_InitializeRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e)
{
if (!(e.Row.Cells.FromKey("AgentName").Value.Equals(" ")))
{
e.Row.Cells.FromKey("Name").Text = "<A Href=\"javascript:AgentDetails('" + e.Row.Cells.FromKey("AgentId") + "','" + agentAcctID + "')\" class='GridAnchor'> " + e.Row.Cells.FromKey("AgentName").Text + "</a>";
}
}
在上面的代码中,我在 JavaScript 函数中传递了两个参数(agentid
和)。accountid
在绑定上述函数中的超链接列时。它在超链接列中使用 asc 对网格数据进行排序,agentid
而不是显示名称为 asc 的排序列。