listview Sorting in ajax update panel not working

Author Topic
Rajesh Sunkari
Member

Joined: 07 Dec 2008
Country:
Posts: 1

Posted: 07 Dec 2008 13:38:05

I have used a list view in Ajax Update panel. And iam using this listview in a user control. and this user control is placed in a Master Page.I have implemented sorting for list view . For the intial page load, complete data appearsin both IE and Firefox. I have three links for Sorting, based on which data changes. This works fine in Internet explorer, but in Firefox, sorting is not working.

When i debug, I saw that for initial page load data is getting loaded in both IE and firefox.But, when sorting link or any other link is clicked, this method is not fired in firefox.I used the condition Ispostback. In case of Internet Explorer, when it is not Ispostback, the debug point is going to the footer control page load of master page and comming back to the sort method and sorting is implemented. But in case of Firefox, the debug point is going to the footer control page load in master page, but it is not comming back.So the method is not firing.can any tell why this is not working in firefox.

The code for the above scenario:



if (!IsPostBack)

{

LoadAllData();

}

protected void lvWorkItems_Sorting(object sender, ListViewSortEventArgs e)

{

string sortExpression = e.SortExpression + " " + "ASC";

if (ViewState["datatab"] != null)

{

DataTable dtProductsqq = (DataTable)ViewState["datatab"];

DataView sortdataview = new DataView(dtProductsqq);

sortdataview.Sort = sortExpression;

lvWorkItems.DataSource = sortdataview;

lvWorkItems.DataBind();

}

}

I have used a list view in Ajax Update panel. And iam using this listview in a user control. and this user control is placed in a Master Page.I have implemented sorting for list view . For the intial page load, complete data appearsin both IE and Firefox. I have three links for Sorting, based on which data changes. This works fine in Internet explorer, but in Firefox, sorting is not working.

When i debug, I saw that for initial page load data is getting loaded in both IE and firefox.But, when sorting link or any other link is clicked, this method is not fired in firefox.I used the condition Ispostback. In case of Internet Explorer, when it is not Ispostback, the debug point is going to the footer control page load of master page and comming back to the sort method and sorting is implemented. But in case of Firefox, the debug point is going to the footer control page load in master page, but it is not comming back.So the method is not firing.can any tell why this is not working in firefox.

The code for the above scenario:



if (!IsPostBack)

{

LoadAllData();

}

protected void lvWorkItems_Sorting(object sender, ListViewSortEventArgs e)

{

string sortExpression = e.SortExpression + " " + "ASC";

if (ViewState["datatab"] != null)

{

DataTable dtProductsqq = (DataTable)ViewState["datatab"];

DataView sortdataview = new DataView(dtProductsqq);

sortdataview.Sort = sortExpression;

lvWorkItems.DataSource = sortdataview;

lvWorkItems.DataBind();

}

}
Follow us on twitter Subscribe to our RSS feed
Activate your free membership today | Login | Currency