- Home
- LLBLGen Pro
- Bugs & Issues
DevExpress ASPXGridView showing old data with LLBLGenPro
Joined: 04-Feb-2009
Hi All
Wondering if anyone has come across this issue with the DevExpress grid.
I've done the following.
- Create a grid with manual column definitions
- Set the edit mode of the grid to EditForm (which shows the edit form below the row in the grid).
- Enable client-side processing mode (i.e. EnableCallBacks=true, so no postbacks). Everything done with ajax/javascript.
- Bind to LLBLGenPro datasource
Everything works OK including clicking the Edit button to enter edit mode. The columns are rendered and the data is bound appropriately. Upon saving a change that change is reflected in the grid row.
However, upon clicking Edit again, the edit form reappears but with the original data still in it
It appears that the Edit Form is being cached but I cannot seem to fix this by changing browser settings to avoid caching or clearing the browser cache. I don't know whether the problem lies in the grid or in LLBLGenPro but figured that quite a few people here use the DevExpress/LLBLGenPro combo and may have encountered this.
Sample code is all declarative (nothing in the code behind): (excuse the ridiculous verbosity of the markup).
<dxwgv:ASPxGridView ID="gvPropertyMaintenanceReq" runat="server" DataSourceID="dsPropertyMaintenanceReq"
KeyFieldName="MaintenanceRequestId" AutoGenerateColumns="False" Width="100%"
CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" EnableCallBacks="true">
<SettingsBehavior AllowSort="false" AllowDragDrop="false" ConfirmDelete="true" />
<SettingsLoadingPanel Text="Loading ..." Mode="ShowOnStatusBar" ShowImage="false" />
<SettingsEditing Mode="EditForm" />
<Images ImageFolder="~/App_Themes/Aqua/{0}/">
<CollapsedButton Height="15px"
Url="~/App_Themes/Aqua/GridView/gvCollapsedButton.png" Width="15px" />
<ExpandedButton Height="15px"
Url="~/App_Themes/Aqua/GridView/gvExpandedButton.png" Width="15px" />
<DetailCollapsedButton Height="15px"
Url="~/App_Themes/Aqua/GridView/gvDetailCollapsedButton.png" Width="15px" />
<DetailExpandedButton Height="15px"
Url="~/App_Themes/Aqua/GridView/gvDetailExpandedButton.png" Width="15px" />
<HeaderFilter Height="19px" Url="~/App_Themes/Aqua/GridView/gvHeaderFilter.png"
Width="19px" />
<HeaderActiveFilter Height="19px"
Url="~/App_Themes/Aqua/GridView/gvHeaderFilterActive.png" Width="19px" />
<HeaderSortDown Height="5px"
Url="~/App_Themes/Aqua/GridView/gvHeaderSortDown.png" Width="7px" />
<HeaderSortUp Height="5px" Url="~/App_Themes/Aqua/GridView/gvHeaderSortUp.png"
Width="7px" />
<FilterRowButton Height="13px" Width="13px" />
<WindowResizer Height="13px" Url="~/App_Themes/Aqua/GridView/WindowResizer.png"
Width="13px" />
</Images>
<Styles CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua">
<Header Font-Bold="true" />
</Styles>
<Columns>
<dxwgv:GridViewDataTextColumn Caption="Request Id" VisibleIndex="1" Width="80px">
<DataItemTemplate>
<asp:Literal ID="litRequestId" runat="server" Text='<%# AccommodationDatabase.Helper.formatMaintenanceNumber(((Int32)Eval("MaintenanceRequestId")).ToString()) %>' />
</DataItemTemplate>
<EditFormSettings Visible="False" />
</dxwgv:GridViewDataTextColumn>
<dxwgv:GridViewDataDateColumn FieldName="DateLogged" Caption="Date Logged" VisibleIndex="2" Width="100px">
<EditFormSettings Visible="True" VisibleIndex="2" />
</dxwgv:GridViewDataDateColumn>
<dxwgv:GridViewDataDateColumn Caption="Date Due" FieldName="DateDue" VisibleIndex="3" Width="100px">
<EditFormSettings Visible="True" VisibleIndex="3" />
</dxwgv:GridViewDataDateColumn>
<dxwgv:GridViewDataDateColumn Caption="Date Completed" FieldName="DateCompleted" VisibleIndex="4" Width="100px">
<EditFormSettings Visible="True" VisibleIndex="4" />
</dxwgv:GridViewDataDateColumn>
<dxwgv:GridViewDataMemoColumn Caption="Problem Description" FieldName="ProblemDescription" Visible="false">
<EditFormSettings Visible="True" VisibleIndex="5" />
<PropertiesMemoEdit Rows="5" />
</dxwgv:GridViewDataMemoColumn>
<dxwgv:GridViewDataMemoColumn Caption="Contact Description" FieldName="ContactDescription" Visible="false">
<EditFormSettings Visible="True" VisibleIndex="6" />
<PropertiesMemoEdit Rows="5" />
</dxwgv:GridViewDataMemoColumn>
<dxwgv:GridViewDataComboBoxColumn Caption="Logged For" FieldName="LoggedForAdaptId" Visible="false">
<PropertiesComboBox DataSourceID="dsCodeMember" ValueField="MemberId" ValueType="System.Int32" TextField="MemberName" EnableIncrementalFiltering="true" />
<EditFormSettings Visible="True" VisibleIndex="7" />
</dxwgv:GridViewDataComboBoxColumn>
<dxwgv:GridViewDataCheckColumn Caption="Rejected?" FieldName="Rejected" VisibleIndex="5" Width="50px">
<EditFormSettings Visible="True" VisibleIndex="8" />
</dxwgv:GridViewDataCheckColumn>
<dxwgv:GridViewDataTextColumn Caption="Logged By" Visible="false">
<EditItemTemplate>
<asp:Literal ID="litLoggedBy" runat="server" Text='<%# Eval("LoggedByUID") %>' />
</EditItemTemplate>
<EditFormSettings Visible="True" VisibleIndex="9" />
</dxwgv:GridViewDataTextColumn>
<dxwgv:GridViewCommandColumn Caption="Options" VisibleIndex="6" ButtonType="Link">
<EditButton Visible="true" />
<NewButton Visible="true" />
<DeleteButton Visible="true" />
<CancelButton Text="Cancel" Visible="true" />
<UpdateButton Text="Save" Visible="true" />
</dxwgv:GridViewCommandColumn>
</Columns>
<ImagesEditors>
<CalendarFastNavPrevYear Height="19px"
Url="~/App_Themes/Aqua/Editors/edtCalendarFNPrevYear.png" Width="19px" />
<CalendarFastNavNextYear Height="19px"
Url="~/App_Themes/Aqua/Editors/edtCalendarFNNextYear.png" Width="19px" />
<DropDownEditDropDown Height="7px"
Url="~/App_Themes/Aqua/Editors/edtDropDown.png"
UrlDisabled="~/App_Themes/Aqua/Editors/edtDropDownDisabled.png"
UrlHottracked="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png"
Width="9px" />
</ImagesEditors>
</dxwgv:ASPxGridView>
</div>
</asp:Panel>
<llblgenpro:LLBLGenProDataSource ID="dsPropertyMaintenanceReq" runat="server"
EntityCollectionTypeName="Ntpfes.AccommodationDatabase.Data.CollectionClasses.MaintenanceRequestCollection, Ntpfes.AccommodationDatabase.Data"
DataContainerType="EntityCollection">
<SelectParameters>
<asp:QueryStringParameter QueryStringField="id" Name="AccommodationId" ConvertEmptyStringToNull="true" />
</SelectParameters>
<InsertParameters>
<asp:QueryStringParameter QueryStringField="id" Name="AccommodationId" ConvertEmptyStringToNull="true" />
</InsertParameters>
</llblgenpro:LLBLGenProDataSource>
You are right many people are using this combo, and here is a thread about the same issue: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=12322
Joined: 04-Feb-2009
Thanks for the quick response. Makes sense and sounds like a likely culprit.
However, if I set the cache location on the datasource to either Session or ASPNetCache the editor stops saving altogether.
Is the fact that the code posted above is inside a UserControl an issue at all?
UPDATE:
Seems to be okay now, had to re-enable the viewstate on the UserControl and the containing page for the fix of setting the cache location to work.