Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • I need to be able to add a button to each row of a xtraGrid that I can respond to a click event on it. The edit button control does not seem to let me set the text of the button as well as the fact I don't want to edit anything. I have made a linkedit control work for current purposes, but I would prefer a button. How do I go about this? Ability to bind a data value to different properties of the button would be nice too.

                                0

                                Hi Robert,

                                I have attached a sample project showing how this can be done. In short, I am painting a button manually within the CustomDrawCell event and also handle the View's MouseDown event to manage clicks.

                                Thanks,
                                Plato

                                dxSample.zip
                                0

                                Wow, 100 lines of code to accomplish something so simple??!? Can this be converted to a request to add a button control that will function like a regular button to the list of edit controls in a grid so it works similar to the hyperlink edit control?

                                0

                                Hi Robert,

                                Generally, the button can be added to a cell very easy. All you need to do is to set the column's ColumnEdit property to a RepositoryItemButtonEdit instance and set the TextEditStyle property to the HideEditor value. However, this approach does not allow you to set the button's Text property:(. So, this code is necesary to paint proper text on buttons.

                                Thanks,
                                Plato

                                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