Save/Cancel option if user tries to page or leave screen after changes

9 posts, 0 answers
  1. Andrew
    Andrew avatar
    68 posts
    Member since:
    Jul 2010

    Posted 21 Jul 2010 Link to this post

    I noticed that the RadDataPager does not allow users to page once they have changed the data.  That is a nice feature.

    Has anyone programmed a warning and popup if the user goes to the now dead pager so they know why its dead, and to let them decide to update or cancel the changes, or to just close the dialog box.  That same box should pop up if a user tries to navigate away from the page if there are outstanding changes, so they don't inadvertently lose their work.

    Has anyone done this yet?
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 22 Jul 2010 Link to this post

    Hello Andrew,

    That sounds weird. I did not write such a feature :) :) :)

    How did you manage to do it? Could you please send me a sample project in a separate support ticket. I am very interested in how you managed to "kill" the pager. Thanks in advance.

    Sincerely yours,
    Ross
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Andrew
    Andrew avatar
    68 posts
    Member since:
    Jul 2010

    Posted 22 Jul 2010 Link to this post

    I am don't know if sending the entire project will help since I am using sql data and it is required to execute.

    Tell me if this is enough to tell what is going on.  I can tell you it works perfectly, when I change any data, the toolbar stops working, and as soon as I save the changes, it starts working again.  Are you sure this was not done on purpose?  I added the tooltip to give a hint as to why it suddenly stops working, that appears to work, but all the time, not just when its innactive.

      <riaControls:DomainDataSource AutoLoad="True" LoadSize="40" Height="0" 
                               Name="domainDataSource" QueryName="GetCustomersWithShipTo" Width="0">
           <telerik:RadDataPager Name="custpager" Source="{Binding Items, ElementName=radGridView1}" PageSize="20" 
                      ToolTipService.ToolTip="Save Changes First" DisplayMode="All"></telerik:RadDataPager>
    <telerik:RadGridView Name="radGridView1" ItemsSource="{Binding ElementName=domainDataSource, Path=Data}" AutoGenerateColumns="False" 
                            Grid.Row="1" ActionOnLostFocus="None" AlternationCount="2" AlternateRowBackground="Azure"
                             HorizontalAlignment="Stretch"
                        CanUserDeleteRows="{Binding IsChecked, Mode=TwoWay, ElementName=CanUserDeleteRowsCheckBox}"
                        >
  5. Andrew
    Andrew avatar
    68 posts
    Member since:
    Jul 2010

    Posted 22 Jul 2010 Link to this post

    I have uploaded my entire application on a support ticket because of a problem with delete crashing when I save changes.  So you can look at the entire solution if you want, you have it now.
  6. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 22 Jul 2010 Link to this post

    Hi Andrew,

    We had lot's of trouble running the project. We managed to attach the database but now the DomainDataSource is complaining about something. It seems like shooting in the dark, so we have another idea, which will simplify matters a lot (for us).

    We have a sample project that we can run for sure. It uses the well-known AdventureWorks database which is freely available. I know that this will take part of your time, but could you please take this very very simple project and only add the stuff that is needed to exhibit the behaviors that you are faced with.

    When you open the sample project, not how we bound both the grid and the pager to the DDS. Maybe this can change the things for you. This subtle difference is explained thoroughly in mu blog post about the pager. There you will find all possible combinations and their explanations.

    Once you modify our simple project, send it back to us. Add only what is needed to produce the state that you are getting. This will save us a lot of time and help us look at the right place. We know that this will be extra effort on your side, for which we would like to apologize in advance.

    Thank you for your understanding. We are looking forward to hearing from you.

    P.S. By the way, you can find something interesting in my series of blog posts located here.

    Sincerely yours,
    Ross
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Andrew
    Andrew avatar
    68 posts
    Member since:
    Jul 2010

    Posted 22 Jul 2010 Link to this post

    Before I give up on my database, I thought I should see what errors are being generated.  So I have run a profile on SQL, and the last command is
    exec sp_executesql N'delete [dbo].[Customers]
    where ([CustID] = @0)',N'@0 int',@0=1250001592

    I executed that same command on the sql server directly and discovered a relationship issue.  I removed the offending relationship and delete now works.  As soon as you mentioned the database, I felt like an idiot, not profiling this before.  I just assumed I was doing somethign wrong on the programming side.

    So delete now works, thank you.

    To avoid this kind of issue in the future, could you recommend the normal code to capture and display a database error (i.e. sql complains)?

    Sorry this was my response to the deleted issue case, not this case.  My mistake.  I will post another response in a few minutes.

  8. Andrew
    Andrew avatar
    68 posts
    Member since:
    Jul 2010

    Posted 22 Jul 2010 Link to this post

    I will open a support ticket so I can upload the database schema.
  9. Andrew
    Andrew avatar
    68 posts
    Member since:
    Jul 2010

    Posted 22 Jul 2010 Link to this post

    You might be interested to know that DataPager does the exact same thing, so you are probably inheriting this from a Microsoft class without any programming.

  10. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 27 Jul 2010 Link to this post

    Hi Andrew,

    I can assure you that we are not inheriting from Microsoft's DataPager.

    All the best,
    Ross
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner