protected void lstAccessCategory_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataRowView dr = (DataRowView)e.Item.DataItem;

                Label lblCategory = (Label)e.Item.FindControl("lblCategory");
                lblCategory.Text = dr["Category"].ToString();

                DataList lstItem = (DataList)e.Item.FindControl("lstItem");
                if (cboGroup.ToolTip == "1") //check if load from cboGroup_SelectedIndexChanged
                {
                    AccessGroupRights clsAccessGroupRights = new AccessGroupRights();
                    lstItem.DataSource = clsAccessGroupRights.DataList(lblCategory.Text, int.Parse(cboGroup.SelectedValue), "Category, SequenceNo", SortOption.Ascending).DefaultView;
                    clsAccessGroupRights.CommitAndDispose();
                }
                else
                {
                    AccessRights clsAccessRights = new AccessRights();
                    lstItem.DataSource = clsAccessRights.DataList(lblCategory.Text, long.Parse(lblUID.Text), "Category, SequenceNo", SortOption.Ascending).DefaultView;
                    clsAccessRights.CommitAndDispose();
                }
                lstItem.DataBind();
            }
        }
        protected void lstAccessCategory_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataRowView dr = (DataRowView)e.Item.DataItem;

                Label lblCategory = (Label)e.Item.FindControl("lblCategory");
                lblCategory.Text = dr["Category"].ToString();

                DataList lstItem = (DataList)e.Item.FindControl("lstItem");
                AccessGroupRights clsAccessGroupRights = new AccessGroupRights();
                lstItem.DataSource = clsAccessGroupRights.DataList(lblCategory.Text, int.Parse(lblGroupID.Text), "Category, SequenceNo", SortOption.Ascending).DefaultView;
                clsAccessGroupRights.CommitAndDispose();
                lstItem.DataBind();
            }
        }
		private int SaveRecord()
		{
			int id = int.Parse(lblGroupID.Text);

            AccessGroupRights clsAccessGroupRights = new AccessGroupRights();
            AccessGroupRightsDetails clsDetails;
            foreach (DataListItem itemAccessCategory in lstAccessCategory.Items)
            {
                DataList lstItem = (DataList)itemAccessCategory.FindControl("lstItem");
                foreach (DataListItem item in lstItem.Items)
                {
                    HtmlInputCheckBox chkList = (HtmlInputCheckBox)item.FindControl("chkList");
                    HtmlInputCheckBox chkRead = (HtmlInputCheckBox)item.FindControl("chkRead");
                    HtmlInputCheckBox chkWrite = (HtmlInputCheckBox)item.FindControl("chkWrite");

                    clsDetails = new AccessGroupRightsDetails();
                    clsDetails.GroupID = id;
                    clsDetails.TranTypeID = int.Parse(chkList.Value);
                    clsDetails.Read = chkRead.Checked;
                    clsDetails.Write = chkWrite.Checked;

                    clsAccessGroupRights.Modify(clsDetails);
                }
            }
			clsAccessGroupRights.CommitAndDispose();

			return id;
		}