Hi Team,
I am using Infragistics:ultrawebgrid in my project but i am facing an issue for sorting the hyperlink column. i have used below server side method for sorting -
private void GD1_SortColumn(object sender, Infragistics.WebUI.UltraWebGrid.SortColumnEventArgs e) {
if (e.ColumnNo != -1) { switch(GD1.Columns[e.ColumnNo].Key) {
case "Name": { if(GridPager.Visible==false) e.Cancel=true; if (hidenFld1.Value=="true" || hidenFld1.Value==null || hidenFld1.Value==string.Empty) { //hidenFld1.Value="false"; } else { //__submitHandler(); hidenFld1.Value=""; } if(GD1.Columns.FromKey("Name").SortIndicator == Infragistics.WebUI.UltraWebGrid.SortIndicator.Ascending) { __sortColumn = "Name"; __sortDesc = "ASC"; } else { __sortColumn = "Name"; __sortDesc = "DESC"; } break; }
default: e.Cancel = true; break; } }
//__pageNo = GridPager.CurrentPageIndex; //__bindGridData();
if(GridPager.Visible==true) __searchbyData(); - This method is basically passing the parameter in SP and binding in the grid. I have checked the SP and it's working as expected(sorting is working fine while binding the grid) but the problem comes when we create the hyperlink column in GD1_InitializeRow server side method.
}
GD1_InitializeRow server side method -
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("Id") + "','" + AcctID + "')\" class='GridAnchor'> " + e.Row.Cells.FromKey("AgentName").Text + "</a>";
As you see the above code. we are passing the two parameters one is id and another is account id. when it calls GD1_InitializeRow server side method then the control automatically sorts with agent id instead of Name. so the problem comes with GD1_InitializeRow server side method.
Please suggest.