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 : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Reg: GridGrouping Control to Datatable

Thread ID:

Created:

Updated:

Platform:

Replies:

33499 Aug 22,2005 11:05 AM UTC Aug 22,2005 11:19 AM UTC WinForms 1
loading
Tags: GridControl
Anna Srinivasan
Asked On August 22, 2005 11:05 AM UTC

Hi, I am copying data from ggc to datatable. I dont want first 3 columns data.(always) I am using following code to do this. Problem: How may rows are there in the grid that many row are created in the datatable.But data are empty in the dt.(But grid contain data) Any idea..? DataTable dt = new DataTable(); int numCols = grid.TableDescriptor.VisibleColumns.Count; int ii = 0; foreach(GridVisibleColumnDescriptor cd in grid.TableDescriptor.VisibleColumns) { if(ii > 2) { string s = grid.TableDescriptor.Columns[cd.Name].HeaderText; dt.Columns.Add(new DataColumn(s, grid.TableDescriptor.Columns[cd.Name].FieldDescriptor.GetPropertyType())); } ii += 1; } int jj = 0; foreach(Record r in grid.Table.FilteredRecords) { dr = dt.NewRow(); foreach(GridVisibleColumnDescriptor cd in grid.TableDescriptor.VisibleColumns) { if (jj > 2) { string s = grid.TableDescriptor.Columns[cd.Name].HeaderText; dr[s] = r.GetValue(cd.Name); } jj += 1; if (jj == 4) { jj = 0; } } dt.Rows.Add(dr); } dt.AcceptChanges(); Thanks, Anna

Administrator [Syncfusion]
Replied On August 22, 2005 11:19 AM UTC

When you debug your code, what is the first step that does not behave properly? (ie. as you execute your loops, what is the first unexpected value you see?)

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

;