locked
How do i show player name from player table in player points tables. RRS feed

  • Question

  • User36582938 posted

    I am trying to make a foregin key as per diagram so that I can display the player name in the telerik rad grid I have tried to create a foreign key but sql designer saids not unique i dont no how to solve this.

    This is my edmx so far

    I am filling my radgrid with the following entity data source.

       <div class="title_left">
                                <h3>Points Managment</h3>
                            </div>   <asp:ScriptManager ID="sptgrdSoccerPlayers" runat="server"></asp:ScriptManager>
      
        <asp:EntityDataSource ID="entPoints" runat="server" ConnectionString="name=soccerEntities" DefaultContainerName="soccerEntities" EnableFlattening="False" EntitySetName="player_points" Select="it.[id], it.[playerId], it.[points], it.[pointsToRedeem], it.[dateToBeAwarded], it.[approvedBy], it.[approved], it.[authCreatedDate], it.[modifiedDate], it.[modifiedBy], it.[isActivated], it.[authUserName], it.[siteId], it.[sentApproveEmail], it.[approvedDate], it.[playerNumber], it.[playerName], it.[teamId], it.[isProcessed], it.[sentEmailToAdmin], it.[sentEmailToUser]"></asp:EntityDataSource>
    <telerik:RadGrid ID="grdPoints" runat="server" AllowAutomaticDeletes="True" RenderMode="Auto" DataSourceID="entPoints" GroupPanelPosition="Top" OnItemCommand="grdPoints_ItemCommand" CellSpacing="-1" GridLines="Both" Skin="Bootstrap" AutoGenerateEditColumn="True">
        <MasterTableView AutoGenerateColumns="False" DataSourceID="entPoints" DataKeyNames="id">
            <Columns>
                <telerik:GridBoundColumn DataField="id" Visible="false" DataType="System.Guid" FilterControlAltText="Filter id column" HeaderText="id" ReadOnly="True" SortExpression="id" UniqueName="id">
                </telerik:GridBoundColumn>
                 <telerik:GridBoundColumn DataField="playerName" FilterControlAltText="Filter playerName column" HeaderText="Player Name" SortExpression="playerName" UniqueName="playerName" ReadOnly="True">
                </telerik:GridBoundColumn>
                 <telerik:GridBoundColumn DataField="playerNumber" FilterControlAltText="Filter playerNumber column" HeaderText="Player Number" SortExpression="playerNumber" UniqueName="playerNumber" ReadOnly="True">
                </telerik:GridBoundColumn>
                
                <telerik:GridBoundColumn DataField="playerId" DataType="System.Guid" FilterControlAltText="Filter playerId column" HeaderText="Player ID" SortExpression="playerId" UniqueName="playerId" ReadOnly="True">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="points" DataType="System.Int32" FilterControlAltText="Filter points column" HeaderText="Points" SortExpression="points" UniqueName="points" ReadOnly="True">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="pointsToRedeem" DataType="System.Int32" FilterControlAltText="Filter pointsToRedeem column" HeaderText="Redeem" SortExpression="pointsToRedeem" UniqueName="pointsToRedeem" ReadOnly="True">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="dateToBeAwarded" DataType="System.DateTime" FilterControlAltText="Filter dateToBeAwarded column" HeaderText="Award Date" SortExpression="dateToBeAwarded" UniqueName="dateToBeAwarded" ReadOnly="True">
                </telerik:GridBoundColumn>
                
                   <telerik:GridCheckBoxColumn DataField="isActivated" DataType="System.Boolean" FilterControlAltText="Filter isActivated column" HeaderText="Activated" SortExpression="isActivated" UniqueName="isActivated" ReadOnly="True">
                </telerik:GridCheckBoxColumn>
                 <telerik:GridCheckBoxColumn DataField="isProcessed" DataType="System.Boolean" FilterControlAltText="Filter isProcessed column" HeaderText="Processed" SortExpression="isProcessed" UniqueName="isProcessed" ReadOnly="True">
                </telerik:GridCheckBoxColumn>
                   <telerik:GridBoundColumn DataField="approvedDate" DataType="System.DateTime" FilterControlAltText="Filter approvedDate column" HeaderText="Date Approved" SortExpression="approvedDate" UniqueName="approvedDate" ReadOnly="True">
                </telerik:GridBoundColumn>
                 <telerik:GridCheckBoxColumn DataField="approved" DataType="System.Boolean" FilterControlAltText="Filter approved column" HeaderText="Approved" SortExpression="approved" UniqueName="approved" ReadOnly="True">
                </telerik:GridCheckBoxColumn>
                
            </Columns>
        </MasterTableView>

    Friday, November 13, 2015 8:39 AM

Answers

All replies