You, can't sort the values in a datagrid from outer side, but using the columns click of grid on individual columns you can do this go through the following coding.
try {
if (SortType == false) {
SortView.Sort = e.SortExpression + " ASC";
//dviewGeneral.Sort = e.SortExpression & " ASC"
Session.Item("SortOrder") = SortView.Sort.ToString;
SortType = true;
} else {
SortView.Sort = e.SortExpression + " DESC";
Session.Item("SortOrder") = SortView.Sort.ToString;
//dviewGeneral.Sort = e.SortExpression & " DESC"
SortType = false;
}
CMSgrid.SelectedIndex = -1;
CMSgrid.CurrentPageIndex = 0;
SortBind();
} catch (Exception ex) {
MessgeBox.show(ex.ToString());
}
Saikalyankumar
Junior Poster in Training
91 posts since Mar 2011
Reputation Points: 8
Solved Threads: 23