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.

Convert Gridgroupingcontrol.table.currentrecord into single datarow

Thread ID:

Created:

Updated:

Platform:

Replies:

124728 Jun 25,2016 09:31 AM Jun 28,2016 12:51 AM Windows Forms 3
loading
Tags: GridGroupingControl
Michael K
Asked On June 25, 2016 09:31 AM

Dear All :


While I try to write a code update some value into GGC current selected record
But it state that GridGroupingControl,table.currentrecord is read only object and cannot be update

For this case, can you tell me how to convert GridGroupingControl,table.currentrecord into datarow, So I can update the value in the select row of GCC

Thanks for your help 


Michael

Piruthiviraj Malaimelraj [Syncfusion]
Replied On June 27, 2016 06:00 AM

Hi Michael, 
 
Thank you for using Syncfusion products. 
 
Query 
Solution 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Can you tell me how to convert GridGroupingControl,table.currentrecord into datarow, So I can update the value in the select row of GCC 
Suggestion - 1 
 
Using GetData() method: 
 
The data row can be retrieved and it can be updated for the current record value by using GetData() method. Please make use of below code. 
 
Code snippet 
private void button1_Click(object sender, EventArgs e) 
    //Using GetData() method 
    if (this.gridGroupingControl1.Table.CurrentRecord != null
    { 
        DataRowView dataRowView = this.gridGroupingControl1.Table.CurrentRecord.GetData() as DataRowView
        dataRowView.Row["Col1"] = "NewValue"
    }     
} 
 
 
Suggestion  - 2 
 
Using SetValue() method: 
 
The current record value can be updated by using SetValue() method. Please make use of below code. 
 
Code snippet 
private void button1_Click(object sender, EventArgs e) 
    //Using SetValue() method. 
    if (this.gridGroupingControl1.Table.CurrentRecord != null
    { 
        this.gridGroupingControl1.Table.CurrentRecord.SetValue("Col1", "NewValue"); 
    }   
} 
 
Sample link 

Regards, 
Piruthiviraj 


Michael K
Replied On June 27, 2016 11:07 AM

Dear Piruthiviraj 

Get it, thanks for your help

Michael

Piruthiviraj Malaimelraj [Syncfusion]
Replied On June 28, 2016 12:51 AM

Hi Michael, 

We are glad to hear from you that the given solution is resolved your problem. Please let us know if you have any other queries. 

Regards, 
Piruthiviraj 


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.

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.

;