![]() |
| | #1 |
| unleashed Join Date: Sep 2003
Posts: 693
| SortCommand Event When I click one of the header title to invoke the DataGridSortCommandEventHandler, the section B is only executed if line A exists. I need to be able to execute section B without having line A. Code: private void Page_Load(object sender, System.EventArgs e)
{
dgQuick.SortCommand +=
new DataGridSortCommandEventHandler(dgQuick_SortCommand);
if (!Page.IsPostBack)
{
bindData("ID");
}
bindData("Subject"); // LINE A ####
}
private void dgQuick_SortCommand(object source,
DataGridSortCommandEventArgs e)
{
// SECTION B ####
Response.Write("dgQuick_SortCommand");
bindData(e.SortExpression);
}
private void bindData(String sortExpression)
{
Response.Write(sortExpression);
taskManager = new TaskManager(Server.MapPath(@"data\data.xml"));
TaskList ts = taskManager.GetTaskList();
TaskComparer comparer = new TaskComparer(sortExpression);
ts.Sort(comparer);
dgQuick.DataSource = ts;
dgQuick.DataBind();
}
__________________ source: compsci textbooks, cboard.cprogramming.com, world wide web, common sense |
| alphaoide is offline | |
| | #2 |
| unleashed Join Date: Sep 2003
Posts: 693
| Solved it. The problem was I had the EnableViewState set to false
__________________ source: compsci textbooks, cboard.cprogramming.com, world wide web, common sense |
| alphaoide is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|