Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Hello

                                    I try to find the event where to reset Aspxgridview pageindex = 0 on
                                    http://www.devexpress.com/Support/Center/p/Q207278.aspx i found plato suggestion that i need to put pageindex reset on Page_LoadComplete

                                      Protected Sub Page_LoadComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadComplete
                                            gridaddmovies.PageIndex = 0
                                        End Sub

                                    The problem is that this solve one problem (so for example if i search for hitman and then i search for rambo i will get to the first rambo result page) but this create another problem the chechbox for select working only on first result page for other page when i select item there is no selected item in listbox from gridview.

                                    Also if i select any item on first page and try to change theme or search another query i get Input string was not in a correct format error
                                    Please look my sample project in attachment.
                                    Basically i need to do this:

                                    1 Each time user perform a search display first result page
                                    2 when user check/uncheck some item on page display/remove it from listbox
                                    3 if some item are checked, change theme or make new query with no error

                                    Can you help me?

                                    Thank you

                                WebSite1.rar
                                0

                                Hi Johny,

                                Thank you for the report. Unfortunately, it is unclear how to reproduce the problem you reported to us, using the project. Could you please explain it to us in greater detail? We will do our best to help you.

                                Thanks,
                                Plato

                                0

                                Run the sample project

                                1 On textbox type hitman click on search check the first item then try change theme
                                Error = Input string was not in a correct format

                                2 On textbox type hitman click on search check the first item then on textbox type rambo and click search
                                Error = Input string was not in a correct format

                                3 On textbox type hitman click on search check the first item on second page scroll down to listbox
                                Error = there is no selected item on listbox

                                All 3 error are related to gridaddmovies.PageIndex and gridaddmovies.Selection.
                                If i don't set gridaddmovies.PageIndex = 0 on Page_LoadComplete then when a query change the pageindex is set on preview query index

                                for example the first query is hitman the second is rambo. To reproduce this comment gridaddmovies.PageIndex = 0 On textbox type hitman click on search click on last page 56 on textbox type rambo click search you will see page 12 (the last page of rambo query)

                                So i need a way to reset PageIndex and show 1 page for each query. When i put gridaddmovies.PageIndex = 0 on Page_LoadComplete i get the first result for each query but also i can't get selected item from any other then first page in listbox

                                For example

                                On textbox type hitman click on search check the first item on second page scroll down there is no selected item in listbox

                                How can i fix this 3 error?

                                thank you

                                0

                                Hi Johny:

                                We're working on this issue and will answer you as soon as possible. We're sorry for the delay.

                                Thanks
                                Kate.

                                0

                                Hi Johny:

                                We've reproduced all problems.

                                The first two may be solved by replacing the selList.AddItem(values[i], values[i]) with selList.AddItem(values[i][0], values[i][1]).

                                The third problem isn't solved yet. We're currently working on a solution and will answer you as soon as it is found.

                                Thanks
                                Kate.

                                0

                                Hi Johny:

                                The third issue is caused by the fact that you clear the selection via the gridaddmovies.Selection.UnselectAll() method, which is called in the gridaddmovies_PageIndexChanged event handler.
                                You can solve this problem by resetting the PageIndex by clicking the Search button:

                                	
                                [VB.NET]
                                Protected Sub gridaddmovies_PageIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles gridaddmovies.PageIndexChanged newindex = gridaddmovies.PageIndex + 1 gridaddmovies.DataBind() End Sub Protected Sub Page_LoadComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadComplete End Sub Protected Sub btnsearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsearch.Click gridaddmovies.Selection.UnselectAll() gridaddmovies.PageIndex = 0 newindex = gridaddmovies.PageIndex + 1 gridaddmovies.DataBind() End Sub

                                Please also note that the current selection will show only selected data on the current page.

                                Thanks
                                Kate.

                                0

                                Hello

                                I try make changes like in your sample code but now the parameter title and image is empty to be clear i get only the asin value with selList.AddItem(values[i][0], values[i][1], values[i][2]);

                                To reproduce this run the sample project.
                                On textbox type hitman select the first two result scroll down and on combobox select list1 then click on add selected button. I put msgbox on ASPxCallbackPanel1_Callback to see the value i get. The value pars(0) is reserved for addselected, pars(1) is reserved for idlist and in the other pars value i expect 3 parameter title,asin,image.

                                How can i get this parameter?

                                In old code selList.AddItem(values[i], values[i], values[i]); i get this 3 parameter in format title,asin,image but title can have inside , character so i can't use this for parse.

                                Can you advice me a better solution?

                                Thank you

                                WebSite1.rar
                                0

                                Hi Johny:

                                We're working on your issue and will answer you as soon as possible. We're sorry for the delay.

                                Thanks
                                Kate.

                                0

                                Hi Johny:

                                In this situation I suggest that you change the logic as follows:

                                1) Save selection to the listbox

                                On the click of the "Add selected" button:

                                2) Send an "empty" callback from the ASPxCallbackPanel
                                3) Get saved selection on the server side, get required values and save them
                                4) Send a callback from the ASPxGridView and clear the selection.

                                I've modified your sample according to this solution and attached it.

                                Thanks
                                Kate.

                                dxSample_Q247546.zip

                                To start a chat you should create a support ticket


                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners