Hello,
I've developed custom webpart for edit external database. I used LinqDataSource for connect to database and custom DataSource in web.config. When I try edit row in Grid, page is postback and edited data is actualize from db but no Update changes.
If I placed my code to separate page out from Kentico. Everything goes good...
Here is code of my webpart:
<asp:GridView ID="gridSites" runat="server" DataSourceID="dsSites" AutoGenerateColumns="false"
DataKeyNames="ID">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" />
<asp:BoundField DataField="Name" HeaderText="Name" />
<asp:BoundField DataField="UrlForReplace" HeaderText="UrlForReplace" />
<asp:TemplateField HeaderText="Provider">
<ItemTemplate>
<%# Eval("Provider.Name") %>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="ddProvider" runat="server" DataSourceID="dsProviders" DataValueField="ID"
DataTextField="Name">
</asp:DropDownList>
<asp:LinqDataSource ID="dsProviders" runat="server" ContextTypeName="FlinkerDataDefinitionDataContext"
EntityTypeName="" TableName="Providers">
</asp:LinqDataSource>
</EditItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="SiteParameter" HeaderText="SiteParameter" />
<asp:CheckBoxField DataField="ReplaceUrl" HeaderText="ReplaceUrl" />
<asp:CommandField ShowEditButton="True" ShowDeleteButton="true" CancelText="Zpět"
EditText="Upravit" UpdateText="Uložit" HeaderStyle-Width="150px" />
</Columns>
</asp:GridView>
<asp:LinqDataSource ID="dsSites" runat="server" ContextTypeName="FlinkerDataDefinitionDataContext"
EntityTypeName="" TableName="Sites" EnableUpdate="true">
</asp:LinqDataSource>
Please help me...
Thank you David