I am facing an issue for sorting the hyperlink column in infragistic ultra webgrid. I'm using server side sort method to sort the column - GD1_sortcolumn
and passing the asc, desc and other parameters accordingly bind the data in ultra webgrid it's working fine here and sorting is also working fine with Name column. For example I have passed the Name column and asc parameter then it calls sp with these parameters. I got the datatable with sorted values and bind the datatable with grid successfully.
The problems comes in the GD1_InitializeRow
method when the hyperlink is created. Please find the below code:
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>";
}
}
In the above code I had passed the two parameters(agentid
and accountid
) in the JavaScript function. While binding the hyperlink column in above function. it's sorting the grid data with agentid
asc in hyperlink column instead of showing the sort column with name asc.