ViewState["sortExpression"] = "Isdistribution";
ViewState["sort"] = " ASC";
}
//Binding information
BindNodeInfo();
}
public void BindNodeInfo()
{
NodeLogic log = new NodeLogic();
DataSet myset = (); //Get the data source
DataView myview = [0].DefaultView;
= ViewState["sortExpression"].ToString() +" "+ ViewState["sort"].ToString();
= myview;
= new string[] { "node_id" }; �
(); �
}
protected void NodeGridView_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
= ;
BindNodeInfo();
}
protected void NodeGridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
// Automatically number the first column
if ( > -1)
{
[0].Text = ( + 1);
}
}
protected void NodeGridView_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
NodeLogic log = new NodeLogic();
int id = ([].Values[0].ToString());
if ((id))
{
((), "", "alert('Delete successfully!');", true);
}
else
((), "", "alert('Deletion failed!');", true);
//Reupdate the data display
BindNodeInfo();
}
protected void NodemGridView_RowEditing(object sender, GridViewEditEventArgs e)
{
}
protected void AddNode_Click(object sender, EventArgs e)
{
("");
}
protected void NodeGridView_Sorting(object sender, GridViewSortEventArgs e)
{
if (ViewState["sortExpression"] != null)
{
if (ViewState["sort"].ToString() == "Asc")
{
ViewState["sort"] = "Desc";
}
else
{
ViewState["sort"] = "Asc";
}
}
BindNodeInfo();
}