Hello Timothy,
This is the front end of the repeater:
<asp:Repeater ID="uiRptCommitteeMemberDetails" runat="server" OnItemDataBound="uiRptCommitteeMember_OnItemDataBound">
</asp:Repeater>
And that is the back end:
protected void Page_Load(object sender, EventArgs e)
{
DataBindControl();
}
/// <summary>
/// DataBind controls
/// </summary>
public void DataBindControl() {
uiPhViewCommitteeMemberInDetail.Visible = false;
uiPhViewCommitteeMember.Visible = false;
string siteName = SiteContext.CurrentSite.SiteName;
DataTable table = null;
if (MembershipContext.AuthenticatedUser.IsGlobalAdministrator || CIA.Data.CommitteeMember.IsCommityMember()) {
uiPhViewCommitteeMemberInDetail.Visible = true;
table = CommitteeMember.GetAllMembers(DocumentContext.CurrentDocument.NodeGUID, true, "ItemOrder, Committee, Role");
uiRptCommitteeMemberDetails.DataSource = table;
uiRptCommitteeMemberDetails.DataBind();
} else {
uiPhViewCommitteeMember.Visible = true;
table = CommitteeMember.GetAllMembers(DocumentContext.CurrentDocument.NodeGUID, true, "ItemOrder, Committee, Role");
uiRptCommitteeMember.DataSource = table;
uiRptCommitteeMember.DataBind();
}
if (table == null) {
this.Visible = false;
return;
}
if (table.Rows.Count == 0) {
this.Visible = false;
return;
}
}
public static DataTable GetAllMembers(Guid activityNodeGUID, bool? display, string orderBy)
{
DataSet testDs = null;
QueryDataParameters parameters = new QueryDataParameters();
parameters.Add("@ActivityNodeGUID", activityNodeGUID);
parameters.Add("@Display", display);
//Call the query that is defined through Kentico CMS
if (string.IsNullOrEmpty(orderBy)){
orderBy = "ORDER BY ItemID";
} else if (!orderBy.StartsWith("ORDER BY", StringComparison.OrdinalIgnoreCase)) {
orderBy = string.Concat("ORDER BY ", orderBy);
}
testDs = ConnectionHelper.ExecuteQuery("CIA.ActivityCommitteeMember.selectMemberUserDetails", parameters, null, orderBy);
return testDs.Tables[0];
}
So as you can see I am getting the data from the custom table and it is ordered by ItemID but I can't order by item id using the custom table application inside the CMS. Because I need to filter it and as soon I click in the arrow the page refreshes and the filter got lost.
Hope that helps
Thanks
Thiago