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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Reg: Copy data from GridGroupingControl to DataTable

Thread ID:

Created:

Updated:

Platform:

Replies:

31238 Jul 4,2005 12:14 PM UTC Jul 5,2005 12:34 PM UTC WinForms 5
loading
Tags: GridControl
Anna Srinivasan
Asked On July 4, 2005 12:14 PM UTC

Hi, Source for GridGroupingConrol - DataTable DataTable dt; dt = dataTable.Copy(); If i do copy like this, what is there in dataTable is directly come to my dt(datatable).But i need grid look and feel to dt. Problem Example: If datatable column contain name for example Asset_ID,but while showing in to grid they are showing like this ''Asset'' Q1: I need datatable like what is there in grid.? Help me..!

Administrator [Syncfusion]
Replied On July 4, 2005 01:14 PM UTC

Here is a sample that will move the columns into a datatable in the sample order as the grid if that is what you mean by look and feel. http://www.syncfusion.com/Support/user/uploads/ggc_DT_b3e8e41f.zip

Anna Srinivasan
Replied On July 5, 2005 04:44 AM UTC

Hi, Example is working fine....! All records which are present in the grid i can able to get in the dataTable except column headers. Colummn headers i am getting what is there in grid control source dataTable. How do i get column header what is there in gridgrouping control..? Thanks, Anna

Administrator [Syncfusion]
Replied On July 5, 2005 08:40 AM UTC

Instead of naming the columns using cd.Name, name them with the HeaderText. foreach(GridVisibleColumnDescriptor cd in this.gridGroupingControl1.TableDescriptor.VisibleColumns) { string s = this.gridGroupingControl1.TableDescriptor.Columns[cd.Name].HeaderText; dt.Columns.Add(new DataColumn(s, this.gridGroupingControl1.TableDescriptor.Columns[cd.Name].FieldDescriptor.GetPropertyType())); }

Anna Srinivasan
Replied On July 5, 2005 11:19 AM UTC

Hi, In your example , i need to change any of the code in this line. dr[cd.Name] = r.GetValue(cd.Name); b''cause. If i dint change i am getting following error. Additional information: Column ''OUTST_QTY'' does not belong to table . Note : ''OUTST_QTY'' this column belongs to grid source table One more thing , I tried with header text string in [dr[cd.Name] = r.GetValue(cd.Name);] this point i am getting only header but not data which are present in the grid. Help me...!

Administrator [Syncfusion]
Replied On July 5, 2005 12:34 PM UTC

Here is a sample that has different headertext than column names. http://www.syncfusion.com/Support/user/uploads/ggc_DT_679e7885.zip

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

;