protected void Collapse_Expand_Click(object sender, System.EventArgs e) { string sType = hdnColType.Value; string ceType = hdnCollapseExpand.Value; if (sType.ToLower() == "contact") { PrimaryKeyId contactUid = PrimaryKeyId.Parse(hdnToDoId.Value); if (ceType == "0") { ToDo.CollapseByClient(contactUid, PrimaryKeyId.Empty); } else { ToDo.ExpandByClient(contactUid, PrimaryKeyId.Empty); } } else if (sType.ToLower() == "org") { PrimaryKeyId orgUid = int.Parse(hdnToDoId.Value); if (ceType == "0") { ToDo.CollapseByClient(PrimaryKeyId.Empty, orgUid); } else { ToDo.ExpandByClient(PrimaryKeyId.Empty, orgUid); } } else if (sType.ToLower() == "noclient") { if (ceType == "0") { ToDo.CollapseByClient(PrimaryKeyId.Empty, PrimaryKeyId.Empty); } else { ToDo.ExpandByClient(PrimaryKeyId.Empty, PrimaryKeyId.Empty); } } hdnColType.Value = ""; hdnToDoId.Value = ""; BindDataGrid(); }