Gridview with DynamicFields and LinqDataSource problem

Last post 05-12-2008 1:43 PM by chenriks. 11 replies.

Sort Posts:

  • Gridview with DynamicFields and LinqDataSource problem

    01-21-2008, 7:10 AM
    • Loading...
    • flecki
    • Joined on 07-07-2004, 7:34 AM
    • Posts 29
    Hi to everyone, I have the following sample below and after I put the save button i got the following error message: "LinqDataSource 'LinqDataSource1' does not support the Update operation unless EnableUpdate is true. " For me it seems that everything is ok, can someone help me ? Regards Thorsten
     
       
    Keine Datensätze vorhanden.
  • Re: Gridview with DynamicFields and LinqDataSource problem

    01-21-2008, 9:08 AM
    • Loading...
    • ecbruck
    • Joined on 12-30-2005, 2:39 PM
    • Des Moines, IA
    • Posts 6,711
    • Moderator

    There is an actual "EnableUpdate" property that must be set to True before updating will work.

    Thanks, Ed

    Microsoft MVP - ASP/ASP.NET

    protected void Post_Answered(object sender, EventArgs e) { if (this.MarkAsAnswered != null) { this.MarkAsAnswered(this, EventArgs.Empty); } }
  • Re: Gridview with DynamicFields and LinqDataSource problem

    01-22-2008, 3:23 AM
    • Loading...
    • flecki
    • Joined on 07-07-2004, 7:34 AM
    • Posts 29

    I set this update property to true but nothing happens. Here is my code: "

     
       
    Keine Datensätze vorhanden. "

  • Re: Gridview with DynamicFields and LinqDataSource problem

    01-22-2008, 3:38 AM
    • Loading...
    • flecki
    • Joined on 07-07-2004, 7:34 AM
    • Posts 29

    Hi how can I add my sample code. If I paste it into this post you can not see it because it is asp.net code. Regards Thorsten
  • Re: Gridview with DynamicFields and LinqDataSource problem

    01-22-2008, 9:22 AM
    • Loading...
    • ecbruck
    • Joined on 12-30-2005, 2:39 PM
    • Des Moines, IA
    • Posts 6,711
    • Moderator

    Add your code to the post using the "Source Code" toolbar button which is the last button on the toolbar.

    Thanks, Ed

    Microsoft MVP - ASP/ASP.NET

    protected void Post_Answered(object sender, EventArgs e) { if (this.MarkAsAnswered != null) { this.MarkAsAnswered(this, EventArgs.Empty); } }
  • Re: Gridview with DynamicFields and LinqDataSource problem

    01-22-2008, 9:29 AM
    • Loading...
    • flecki
    • Joined on 07-07-2004, 7:34 AM
    • Posts 29

    If I push reply to your message I have not got soemthing with post source code ?
  • Re: Gridview with DynamicFields and LinqDataSource problem

    01-22-2008, 9:42 AM
    • Loading...
    • ecbruck
    • Joined on 12-30-2005, 2:39 PM
    • Des Moines, IA
    • Posts 6,711
    • Moderator

    Just below the "Message" header is the command toolbar. At the very right should be your "Source Code" button.

    Thanks, Ed

    Microsoft MVP - ASP/ASP.NET

    protected void Post_Answered(object sender, EventArgs e) { if (this.MarkAsAnswered != null) { this.MarkAsAnswered(this, EventArgs.Empty); } }
  • Re: Gridview with DynamicFields and LinqDataSource problem

    01-22-2008, 9:46 AM
    • Loading...
    • flecki
    • Joined on 07-07-2004, 7:34 AM
    • Posts 29

    I'am very sorry but I have not got any source code button. I have Compose, Options, Related, Preview nothing else
  • Re: Gridview with DynamicFields and LinqDataSource problem

    01-22-2008, 9:54 AM
    • Loading...
    • ecbruck
    • Joined on 12-30-2005, 2:39 PM
    • Des Moines, IA
    • Posts 6,711
    • Moderator

    If you don't have a toolbar below the Message header within the Compose tab, then I'm not sure what to tell you.

    Thanks, Ed

    Microsoft MVP - ASP/ASP.NET

    protected void Post_Answered(object sender, EventArgs e) { if (this.MarkAsAnswered != null) { this.MarkAsAnswered(this, EventArgs.Empty); } }
  • Re: Gridview with DynamicFields and LinqDataSource problem

    01-22-2008, 10:08 AM
    • Loading...
    • flecki
    • Joined on 07-07-2004, 7:34 AM
    • Posts 29

    I solve the problem. Now I have the toolbar.

    Here is my sample code:

     

    <asp:DynamicGridView ID="GridView1" runat="server" DataSourceID="LinqDataSource1"

                AutoGenerateColumns="False" EnableQueryStringSelection="True" AllowPaging="True"

                AllowSorting="True" AutoGenerateDeleteButton="false" AutoGenerateSelectButton="false"

                AutoGenerateEditButton="false" PageSize="5" SkinID="GridviewStandard"

                onselectedindexchanging="GridView1_SelectedIndexChanging"  DataKeyNames="EVE_ID">

                <Columns>

                    <asp:DynamicTemplateField ShowHeader="False">

                        <EditItemTemplate>

                            <table cellpadding="0" cellspacing="0" border="0" style="vertical-align: middle;

                                width: 20px">

                                <tr>

                                    <td valign="middle" style="vertical-align: middle; width: 20px">

                                        <asp:ImageButton ID="imageUpdate" runat="server" CausesValidation="True" CommandName="Update"

                                            Text="Update" ImageUrl="~/Icons/Save.gif" Width="16px"></asp:ImageButton>

                                    </td>

                                    <td style="width: 15px">

                                        &nbsp;

                                    </td>

                                    <td valign="middle" style="vertical-align: middle; width: 20px">

                                        <asp:ImageButton ID="imageCancel" runat="server" CausesValidation="False" CommandName="Cancel"

                                            Text="Cancel" ImageUrl="~/Icons/Cancel.gif" Width="16px"></asp:ImageButton>

                                    </td>

                                </tr>

                            </table>

                        </EditItemTemplate>

                        <ItemTemplate>

                            <table cellpadding="0" cellspacing="0" border="0" style="vertical-align: middle;

                                width: 20px">

                                <tr>

                                    <td valign="middle" style="vertical-align: middle; width: 20px">

                                        <asp:ImageButton ID="ImageSelect" runat="server" CausesValidation="False" CommandName="Select"

                                            Text="Select" ImageUrl="~/Icons/Select.gif" Width="16px"></asp:ImageButton>

                                    </td>

                                    <td style="width: 15px">

                                        &nbsp;

                                    </td>

                                    <td valign="middle" style="vertical-align: middle; width: 20px">

                                        <asp:ImageButton ID="ImageEdit" runat="server" CausesValidation="False" CommandName="Edit"

                                            Text="Edit" ImageUrl="~/Icons/Edit.gif" Width="16px"></asp:ImageButton>

                                    </td>

                                    <td style="width: 15px">

                                        &nbsp;

                                    </td>

                                    <%--

                                    <td valign="middle" style="vertical-align: middle; width: 20px">

                                        <asp:ImageButton ID="ImageDelete" runat="server" CausesValidation="False" CommandName="Delete"

                                            Text="Delete" ImageUrl="~/Icons/Delete.gif" Width="16px"></asp:ImageButton>

                                    </td> --%>

                                </tr>

                            </table>

                        </ItemTemplate>

                    </asp:DynamicTemplateField>

                    <asp:DynamicField DataField="EVE_Bezeichnung" RenderHint="Text" HeaderText="Bezeichnung"

                        ItemStyle-Wrap="false">

                        <ItemStyle Wrap="False"></ItemStyle>

                    </asp:DynamicField>

                    <asp:DynamicField DataField="tbl_Eventtype" RenderHint="ForeignKeyWithoutLink" HeaderText="Eventkategorie"

                        ItemStyle-Wrap="false">

                        <ItemStyle Wrap="False"></ItemStyle>

                    </asp:DynamicField>

                    <asp:DynamicField DataField="EVE_Start_Datum" HeaderText="Start-Datum" ItemStyle-Wrap="false">

                        <ItemStyle Wrap="False"></ItemStyle>

                    </asp:DynamicField>

                    <asp:DynamicField DataField="EVE_End_Datum" HeaderText="End-Datum" ItemStyle-Wrap="false">

                        <ItemStyle Wrap="False"></ItemStyle>

                    </asp:DynamicField>

                    <asp:DynamicField DataField="EVE_Maximale_Anzahl_Gaeste" HeaderText="Max. Gäste"

                        ItemStyle-Wrap="false">

                        <ItemStyle Wrap="False"></ItemStyle>

                    </asp:DynamicField>

                    <asp:DynamicField DataField="EVE_Gaeste_Puffer" HeaderText="Gäste Puffer" ItemStyle-Wrap="false">

                        <ItemStyle Wrap="False"></ItemStyle>

                    </asp:DynamicField>

                    <asp:DynamicField DataField="tbl_Currency" HeaderText="Währung" ItemStyle-Wrap="false">

                        <ItemStyle Wrap="False"></ItemStyle>

                    </asp:DynamicField>

                    <asp:DynamicField DataField="EVE_Bemerkung" HeaderText="Bemerkung" ItemStyle-Wrap="false">

                        <ItemStyle Wrap="False"></ItemStyle>

                    </asp:DynamicField>

                    <asp:DynamicField DataField="EVE_Status" HeaderText="Status" ItemStyle-Wrap="false">

                        <ItemStyle Wrap="False"></ItemStyle>

                    </asp:DynamicField>

                </Columns>

                <PagerTemplate>

                    <uc1:GridViewPager runat="server" />

                </PagerTemplate>

                <EmptyDataTemplate>

                    Keine Datensätze vorhanden.

                </EmptyDataTemplate>

            </asp:DynamicGridView>

            <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="AccentureDataContext"

                EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="tbl_Events"

                OnSelecting="LinqDataSource1_Selecting">

            </asp:LinqDataSource>

  • Re: Gridview with DynamicFields and LinqDataSource problem

    01-22-2008, 10:17 AM
    • Loading...
    • ecbruck
    • Joined on 12-30-2005, 2:39 PM
    • Des Moines, IA
    • Posts 6,711
    • Moderator

    Glad you got that working, but I hate to say that I've never seen or used the DynamicGridView control. If I were you, I'd post a new thread to the group to see if someone else may have.

    Good luck!

    Thanks, Ed

    Microsoft MVP - ASP/ASP.NET

    protected void Post_Answered(object sender, EventArgs e) { if (this.MarkAsAnswered != null) { this.MarkAsAnswered(this, EventArgs.Empty); } }
  • Re: Gridview with DynamicFields and LinqDataSource problem

    05-12-2008, 1:43 PM
    • Loading...
    • chenriks
    • Joined on 09-27-2006, 1:07 PM
    • Redmond, WA
    • Posts 48

    Note that this post is asking about the Dynamic Data CTP - forums are here: http://forums.asp.net/t/1192096.aspx.

    You should try out the latest release of Dynamic Data as some of this functionality has changed.

    Christy Henriksson
    ASP.NET Team
Page 1 of 1 (12 items)