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: GridGroupingControl

Thread ID:





32018 Jul 20,2005 04:00 AM UTC Jul 21,2005 09:28 AM UTC WinForms 3
Tags: GridControl
Anna Srinivasan
Asked On July 20, 2005 04:00 AM UTC

Hi, The following code i am using to copy the all information from gridgroupingcontrol to dataTable. DataTable dt = new DataTable(); int numCols = grid.TableDescriptor.VisibleColumns.Count; foreach(GridVisibleColumnDescriptor cd in grid.TableDescriptor.VisibleColumns) { string s = grid.TableDescriptor.Columns[cd.Name].HeaderText; dt.Columns.Add(new DataColumn(s, grid.TableDescriptor.Columns[cd.Name].FieldDescriptor.GetPropertyType())); } foreach(Record r in grid.Table.FilteredRecords) { DataRow dr = dt.NewRow(); foreach(GridVisibleColumnDescriptor cd in grid.TableDescriptor.VisibleColumns) { string s = grid.TableDescriptor.Columns[cd.Name].HeaderText; dr[s] = r.GetValue(cd.Name); } dt.Rows.Add(dr); } dt.AcceptChanges(); Q1: I want to copy display member from grid currently it is copying value member. Please Help me ....! Thanks, Anna

Administrator [Syncfusion]
Replied On July 20, 2005 07:57 AM UTC

The data in the record is the valuemember, that is why you see what you do. One straight forward thing you can do is to look up r.GetValue(cd.Name) in the DataTable (or whatever you are using to provide the look data) and get the display member. If this datasource is a DataTable and you have sorted it on the valuemember column by setting datatable1.DefaultView.Sort = "ValueMemberColName", then use code like: int pos = dt.DefaultView.Find(r.GetValue(cd.Name)); DataRowView drv = dt.DefaultView[pos]; object displaymemberValue = drv["DisplayMemberColName"];

Anna Srinivasan
Replied On July 21, 2005 08:40 AM UTC

Hi, can you please do the same modification in the sample code and send it to me.B''cause i got little confusion. Copy data from grouping grid to datatableggc_DT_b3e8e41f_3160.zip

Administrator [Syncfusion]
Replied On July 21, 2005 09:28 AM UTC

I do not understand. Your sample does not have any column using a displaymember/valuemember. Did you upload the right sample?


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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