Ticket T260882
Visible to All Users

Get value from particular column on double click on another column

created 10 years ago (modified 10 years ago)

Question is derived from the following ticket .
https://www.devexpress.com/Support/Center/Question/Details/T156269
My question is that , how  i can get  value from column[0] always, when double clicked on any column .
How i can do perform.

Answers approved by DevExpress Support

created 10 years ago (modified 10 years ago)

Hello,
You can pass a necessary column to the GetRowCellValue  method instead of getting it from the HitInfo instance.
Here is a code snippet:

C#
private static void DoRowDoubleClick(GridView view, Point pt) { GridHitInfo info = view.CalcHitInfo(pt); if(info.InRow || info.InRowCell) { string colCaption = info.Column == null ? "N/A" : info.Column.GetCaption(); GridColumn col = gridView1.Columns[0]; object val = view.GetRowCellValue(info.RowHandle, col); if(val != null) MessageBox.Show(string.Format("DoubleClick on row: {0}, column: {1}, value: {2}", info.RowHandle, colCaption, val)); } }

I hope this helps.

    Comments (2)
    A A
    Allah Rakha Sahib 1 10 years ago

      Thanks a Lot with pleasure .
      Providing us support regarding to our problems.

      DevExpress Support Team 10 years ago

        You are welcome. Please contact us if you need further assistance.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.