This is a migrated thread and some comments may be shown as answers.

[Solved] Delete Last Row on Page 2 unable to navigate further

3 Answers 113 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 13 May 2009, 09:23 AM
Hi,

I have a slight problem with RAdGrid behaviour. I am using Q1 2009 Ajax Controls and LINQ against SQL server.

I have set up a simple grid for editing the rows in a table, using automatic insert/edit/delete and with paging turned on (using the advanced pager settings).

I note that if the data fits onto exactly 2 pages (i.e. my page size is 20 and I have 21 rows), and I delete the last row on the second page, I am left with an empty gird (No records to display), and no Pager either, so I can't get back to page 1 (except by re-displaying it all).

This is pretty minor - the likelihood of it occuring is small - but it is annoying.

3 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 16 May 2009, 07:06 AM
Hi Andrew,

Could you please send us your grid declaration and any code connected to it and the Linq datasource?

Greetings,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Andrew
Top achievements
Rank 1
answered on 26 May 2009, 11:41 PM
Hi Iana,

Sorry to take so long to reply, but I was diverted into other things (learning to use OA). But having come back round to the same form based on an OA data source I find the same problem.

I have foudn one workaroud which is to make the pager "always visible", but that is still a bit clunky since the user has to click back one page to see the remaining list.

See below for the grid and data source declarations. But note that this also happens on an identical page using an OA datasource.

I am not sure whether it is relevant, but the below code is embedded in a page which has a Master page (to provide the header, footer and a splitter with a tree view used as a menu on the left panle and the grid below on the right). There is also an AJAX manager proxy on the page to Ajaxify the grid.

    <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True"  
        DataSourceID="LinqDataSourceHolidayDates" GridLines="None" Height="100%"  
        AllowAutomaticDeletes="True" AllowAutomaticInserts="True"  
        AllowAutomaticUpdates="True" AutoGenerateColumns="False"
         
        <MasterTableView DataKeyNames="ID"  
            DataSourceID="LinqDataSourceHolidayDates" 
            CommandItemDisplay="Top" EditMode="InPlace" PageSize="20"
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
             
            <Columns> 
                <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID"  
                    ReadOnly="True" SortExpression="ID" UniqueName="ID"
                </telerik:GridBoundColumn> 
                <telerik:GridDateTimeColumn DataField="Holiday_Day" DataFormatString="{0:d}"  
                    DataType="System.DateTime" HeaderText="Date" SortExpression="Holiday_Day"  
                    UniqueName="Holiday_Day" MaxDate="9999-12-31" MinDate="2004-01-01"
                    <HeaderStyle Width="130px" /> 
                </telerik:GridDateTimeColumn> 
                <telerik:GridBoundColumn DataField="Descr" HeaderText="Descr"  
                    SortExpression="Descr" UniqueName="Descr"
                    <HeaderStyle Width="350px" /> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="timestamp" DataType="System.Int32"  
                    HeaderText="timestamp" SortExpression="timestamp" UniqueName="timestamp"  
                    Visible="False" Display="False" ReadOnly="True"
                </telerik:GridBoundColumn> 
                <telerik:GridEditCommandColumn ButtonType="ImageButton"
                    <HeaderStyle Width="30px" /> 
                </telerik:GridEditCommandColumn> 
                <telerik:GridButtonColumn CommandName="Delete" Text="Delete"  
                    UniqueName="column1" ButtonType="ImageButton"
                    <HeaderStyle Width="30px" /> 
                </telerik:GridButtonColumn> 
                <telerik:GridTemplateColumn UniqueName="TemplateColumn"
                    <HeaderStyle Width="100%" /> 
                </telerik:GridTemplateColumn> 
            </Columns> 
 
            <EditFormSettings> 
                <EditColumn UniqueName="EditCommandColumn1"></EditColumn> 
            </EditFormSettings> 
 
            <PagerStyle Mode="NextPrevNumericAndAdvanced" Position="Top" /> 
        </MasterTableView> 
        <ClientSettings> 
            <scrolling allowscroll="True" usestaticheaders="True" /> 
        </ClientSettings> 
    </telerik:RadGrid> 
    <asp:LinqDataSource ID="LinqDataSourceHolidayDates" runat="server"  
        ContextTypeName="Redstone2.SWAP_Mappings.SwapDataClassesDataContext"  
        EnableDelete="True" EnableInsert="True" EnableUpdate="True"  
        OrderBy="Holiday_Day" TableName="Holiday_Dates"
    </asp:LinqDataSource> 
 
0
Iana Tsolova
Telerik team
answered on 27 May 2009, 12:16 PM
Hi Andrew,

Thank you for getting back to us and for providing additional information on this case.

I followed your steps and was able to replicate the described behavior. It seems that there is some issue with the LinqDataSource control and the datasource controls like it. However, we will have to perform further research to find a general resolution it.
Currently I suggest that you look at the workaround provided in the attached sample and see if it works for you.

Kind regards,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Andrew
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or