Hey Board,
I just spent 20 minutes writing out a post and hit the back button... *bangs head on desk*... Sorry this one is shorter, but I have to get some sleep!
My question pertains to the following table structure: http://www.photolava.com/view/cj39.html
Quick Explanation:
Members are people within an organization to which "Admins" create Events (AtEvents) for. They then keep track of people who attend and assign credits to them.
Generated Code: http://www.photolava.com/view/cj37.html (Note I removed the Hyperlink Navigation Properties from the HyperLinkFields and also changed the default FName to display Email.)
BEGING COPY OF CODE
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<h2>
At Member Event List</h2>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<data:GridViewSearchPanel ID="GridViewSearchPanel1" runat="server" GridViewControlID="GridView1"
PersistenceMethod="Session" />
<br />
<data:EntityGridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
DataSourceID="AtMemberEventDataSource" DataKeyNames="MemberUid, EventUid" AllowMultiColumnSorting="false"
DefaultSortColumnName="" DefaultSortDirection="Ascending" ExcelExportFileName="Export_AtMemberEvent.xls">
<Columns>
<asp:CommandField ShowSelectButton="True" ShowEditButton="False" />
<data:HyperLinkField HeaderText="Member" DataContainer="MemberUidSource" DataTextField="Email"
SortExpression="MemberUID" />
<data:HyperLinkField HeaderText="Event" DataContainer="EventUidSource" DataTextField="EventName" SortExpression="EventUID" />
<asp:BoundField DataField="CreditEarned" HeaderText="Credit Earned" SortExpression="CreditEarned" />
</Columns>
<EmptyDataTemplate>
<b>No AtMemberEvent Found!</b>
</EmptyDataTemplate>
</data:EntityGridView>
<br />
<asp:Button runat="server" ID="btnAtMemberEvent" OnClientClick="BLOCKED SCRIPTlocation.href='AtMemberEventEdit.aspx'; return false;"
Text="Add New"></asp:Button>
</ContentTemplate>
</asp:UpdatePanel>
<data:AtMemberEventDataSource ID="AtMemberEventDataSource" runat="server" SelectMethod="GetPaged"
EnablePaging="True" EnableSorting="True" EnableDeepLoad="True">
<DeepLoadProperties Method="IncludeChildren" Recursive="False">
<Types>
<data:AtMemberEventProperty Name="AtEvent" />
<data:AtMemberEventProperty Name="AtMember" />
</Types>
</DeepLoadProperties>
<Parameters>
<data:CustomParameter Name="WhereClause" Value="" ConvertEmptyStringToNull="false" />
<data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" />
<asp:ControlParameter Name="PageIndex" ControlID="GridView1" PropertyName="PageIndex"
Type="Int32" />
<asp:ControlParameter Name="PageSize" ControlID="GridView1" PropertyName="PageSize"
Type="Int32" />
<data:CustomParameter Name="RecordCount" Value="0" Type="Int32" />
</Parameters>
</data:AtMemberEventDataSource>
</asp:Content>
END COPY OF CODE
Now for the questions at hand (please note that these may not seem pertinant for this example, but they come up other places in the code... I just tried to get it down to a simple implimentation that demonstrated both for purposes of this post):
1. Assuming they add 20 events and have ~200 users (and growing)... This table should be a doosey! If you look at the generated page, There is no way to search and/or drill down on this table by Member Email. What is the best way to impliment this into the search bar on the top?
2. Assuming you currently click sort on either Event or Member, it sorts by the GUID instead of the displayed field. If I replace the GUID sort expression above, I get an "Invalid Coumn Name 'Email'" exception (because the column is in an object/table other than the one in the gridview/datasource). How do I get the gridView to sort by Email out of the member table?
I know either of these can beaccomplishedwith another workaround (custom controls, querystrings, etc...) but I feel like I'm just missing something.
Thanks in Advance!!!
-Tom