Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Hi
                                    I'm newbie with ASPxGridView and I would like to know how to edit a row using a popup from a context menu clicking anywhere in row.
                                    I saw a example from http://www.devexpress.com/Support/Center/e/E38.aspx but this example is using a template column, something like that...
                                    <dxwgv:GridViewDataColumn VisibleIndex="0">
                                                        <EditFormSettings Visible="false" />
                                                        <DataItemTemplate>
                                                            <a onclick="ShowContextMenu(this, <%# Container.VisibleIndex %>)" href="#">Edit</a>
                                                        </DataItemTemplate>
                                                    </dxwgv:GridViewDataColumn>

                                    where ShowContextMenu is
                                    function ShowContextMenu(el, visibleIndex) {
                                        editingVisibleIndex = visibleIndex;
                                        gridMenu.ShowAtElement(el);
                                    }
                                    I will be very happy if you can help me :)
                                    Thank you,
                                    Rolando

                                E38.rar
                                0

                                Hello Rolando,

                                Thank you for the detailed description of the issue. I suggest that you modify the Editing using popup menu example in the following manner:
                                1) Handle the ASPxClientGridView's ContextMenu event:

                                	
                                [ASPx]
                                <ClientSideEvents ContextMenu="ShowContextMenu" />

                                2) Show the ASPxPopupMenu based on the coordinates of the event-related mouse pointer position relative to an end-user's screen using the event's e.htmlEvent parameters:

                                	
                                [JScript]
                                function ShowContextMenu(s, e) { var x = ASPxClientUtils.GetEventX(e.htmlEvent); var y = ASPxClientUtils.GetEventY(e.htmlEvent); gridMenu.ShowAtPos(x, y); }

                                Thanks,
                                Mike
                                --------------------
                                Check if Search Engine is able to answer questions faster than I do!
                                --------------------

                                0

                                Hi There!
                                I tried follow your instructions but it didn't work for me :(
                                What I did?:
                                - I downloaded the example from http://www.devexpress.com/Support/Center/e/E38.aspx
                                - I comented the line of code
                                   <dxwgv:GridViewDataColumn VisibleIndex="0">
                                                    <EditFormSettings Visible="false" />
                                                    <DataItemTemplate>
                                                        <a onclick="ShowContextMenu(this, <%# Container.VisibleIndex %>)" href="#">Edit</a>
                                                    </DataItemTemplate>
                                                </dxwgv:GridViewDataColumn>
                                - I added <ClientSideEvents ContextMenu="ShowContextMenu" /> after tag </Columns>
                                - I Changed for js function ShowContextMenu
                                function ShowContextMenu(s, e) {
                                    var x = ASPxClientUtils.GetEventX(e.htmlEvent);
                                    var y = ASPxClientUtils.GetEventY(e.htmlEvent);
                                    gridMenu.ShowAtPos(x, y);
                                }
                                - I added the ClientInstanceName="gridMenu" to ASPxPopupMenu
                                - After that i tried run the example and it doesn't work :(

                                After my that I downloaded the next http://www.devexpress.com/Support/Center/e/E723.aspx related with context menu on header columns but it doesn't work either... very strange because i don't need change anything for this code example.. are there problems with my machine?

                                0

                                The attached file is the same what located in http://www.devexpress.com/Support/Center/e/E723.aspx

                                Note: As you see i change some properties on this issue: (now I m working on win7 + vs2008)

                                E723.rar
                                0

                                Hello Rolando,

                                Thank you for the response. If you run the Editing using popup menu example under version 9.3.x, it's necessary to manually register the ASPxClientUtils scripts in the following manner:

                                	
                                [VB.NET]
                                DevExpress.Web.ASPxClasses.ASPxWebControl.RegisterUtilsScript(Page)

                                I've attached a sample project based on the Editing using popup menu example, illustrating how to implement the required functionality.

                                Thanks,
                                Mike

                                E38.zip
                                0

                                Thank you for your quick answer! :)
                                In relation with the example located in http://www.devexpress.com/Support/Center/e/E38.asp :
                                It's working the context menu in any place of the row, but now the option edit and delete are not doing anything :(. I supose is because the editingVisibleIndex is not seted by the grid or something like that...
                                What I should do to set the editingVisibleIndex??
                                Please let me know if you need more information from my side to reproduce my question :)

                                Note: if you prefer we can close this issue and start a new one:)

                                0

                                Hello Rolando,

                                Thank you for the response. In my previous post, I've attached a sample project where the ASPxGridView editing features are implemented. Please take a look at the attached video. It illustrates how these features work.

                                Concerning the editingVisibleIndex variable: it's necessary to store the active row's visibleIndex before showing the ASPxPopupMenu control. After that, it's necessary to pass the stored active row's visibleIndex to the corresponding ASPxClientGridView's method (such as the ASPxClientGridView.DeleteRow or StartEditRow) that requires visibleIndex as a parameter.

                                See Also:
                                ASPxClientGridView.Methods

                                Thanks,
                                Mike

                                Q268658_2.swf
                                0

                                Hi Mike,
                                 I saw your video/example and now it's working well in my dev-pc :=)!!!
                                What is your sugestion is order don't show the first column?

                                dx:GridViewDataColumn VisibleIndex="0">
                                                         <EditFormSettings Visible="false" />
                                                         <DataItemTemplate>
                                                              <a onclick="ShowContextMenu(this, <%#Container.VisibleIndex%>)" href="#">Edit</a>
                                                         </DataItemTemplate>
                                                    </dx:GridViewDataColumn>

                                any choice?

                                0

                                I seted the property visible=False for the first GridViewDataColumn
                                something like that
                                <dx:GridViewDataColumn VisibleIndex="0" Visible="False">
                                                         <EditFormSettings Visible="false" />
                                                         <DataItemTemplate>
                                                              <a onclick="ShowContextMenu(this, <%#Container.VisibleIndex%>)" href="#"></a>
                                                         </DataItemTemplate>
                                                    </dx:GridViewDataColumn>

                                I think it's working.

                                0

                                Hello Rolando,

                                It's possible to remove the definition of the first ASPxGridView's column from the page's markup, because this column is no longer used. The ASPxPopupMenu control is used for editing the ASPxGridView control.

                                Thanks,
                                Mike

                                0

                                Thank you for your response :)

                                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