We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Resume a specific value from a row, any cell is pressed

Thread ID:

Created:

Updated:

Platform:

Replies:

130729 May 29,2017 05:47 PM UTC May 30,2017 12:38 PM UTC Windows Forms 1
loading
Tags: GridDataBoundGrid(Classic)
Nino
Asked On May 29, 2017 05:47 PM UTC

Hi,
how can this "dataGridView1.CurrentRow.Cells["ID"].Value" be converted for GridDataBound  to have the same effect.
Thanks.


Arulpriya Ramalingam [Syncfusion]
Replied On May 30, 2017 12:38 PM UTC

Hi Nino, 

Thanks for using Syncfusion products. 

We could able to understand your scenario. In GridDataBoundGrid, the cell value of a particular cell can be retrieved from current record value using GetRecordStateAtRowIndex and GetValue methods. The GetRecordStateAtRowIndex method can be used to get the current record and GetValue method can be used to get the particular cell value. Please make use of the provided code sample and KB link, 

Code snippet 
 
//Event Subscription 
gridDataBoundGrid1.CurrentCellControlDoubleClick += GridDataBoundGrid1_CurrentCellControlDoubleClick; 
     
//Event Customization 
private void GridDataBoundGrid1_CurrentCellControlDoubleClick(object sender, ControlEventArgs e) 
{ 
    if (gridDataBoundGrid1.CurrentCell.ColIndex == 2) 
    { 
        int rowIndex = gridDataBoundGrid1.CurrentCell.RowIndex; 
        //To get the current record 
        GridBoundRecordState record = this.gridDataBoundGrid1.Binder.GetRecordStateAtRowIndex(rowIndex); 
        foreach (GridBoundColumn column in this.gridDataBoundGrid1.Binder.InternalColumns) 
        { 
            if (column.MappingName == "Description") 
            { 
                //To get the particular cell value 
                string value = column.PropertyDescriptor.GetValue(record.Table[record.Position]).ToString(); 
                MessageBox.Show(value); 
            } 
        } 
    } 
} 
 
 

Regards, 
Arulpriya 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;