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

                                    I have a requirement to open winform when grid cell's hyperlink is clicked.

                                    Another features of this grid is.. AllowCellMerge = enabled. I mention this because now I created a lookalike text with font options -- blue and underline, but with cell merge the cell could be quite big and clicking anywhere on the cell is opening this winform.

                                    from what I read in knowledge base and other questions, I am little confused whether hyperlinks are supported for readonly, noneditable cells, because this grid is readonly non-editable.

                                    Please suggest what is the correct approach..

                                0

                                Hi Praveena,

                                You should set the column's ColumnEdit to an instance of the RepositoryItemHyperlinkEdit to be able to show a hyperlink in these column cells. If you need to handle a click on these column cells, use the GridView's MouseDown event as shown below:

                                [C#]
                                private void gridView1_Click(object sender, EventArgs e) { MouseEventArgs ee = e as MouseEventArgs; GridView view = sender as GridView; GridHitInfo hInfo = view.CalcHitInfo(ee.X, ee.Y); if(hInfo.InRowCell && hInfo.Column.ColumnEdit == repositoryItemHyperLinkEdit1) { object cellValue = view.GetRowCellValue(hInfo.RowHandle, hInfo.Column); // your code here to show a new form } }

                                This code is necessary, because the RepositoryItem's event won't be fired. The editor won't be activated, because the GridView is disabled for editing.
                                Thanks,
                                Plato

                                0

                                Hi, Thanks for the answer. Cursor is changing to link cursor (which is better than what I had).

                                But the problem of clicking anywhere on the cell still exists. Please find the attached project to see how the first column is rather a tall row and clicking anywhere on the cell opens the form, not just on the text.

                                I implemented what you provided in gridview_click and then moved a little bit over to mouse over and tried to calculate the coordinates of the celltext. for example, if "xxxxxx" is the text displayed in the cell, only clicking that text should open up new form, just like the hyperlink on webside. I implemented that on mouseover to change the cursor and want to restrict users from clicking somehow.

                                I tried "CellValueRect" (I got from searching your knowledgebase) for coordinates of cell text, but looks like it returns the bounds of cell, not the cell text.

                                Please advice how to simulate hyperlink behavior..

                                Praveena

                                GridForCSAL.zip
                                0

                                Hi Praveena,

                                Unfortunately, the HyperLinkEdit doesn't provide this functionality out of the box. Please try a solution suggested in issue How to narrow hyperlinkedit functionality only to text shown in hyperlinkedit?.

                                Thanks,
                                Michael.

                                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