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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PopulateHeaders and PopulateValues problems

Thread ID:





16006 Jul 2,2004 08:50 AM UTC Jul 2,2004 12:44 PM UTC WinForms 1
Tags: GridControl
Derek Stafford
Asked On July 2, 2004 08:50 AM UTC

I''ve looked at previous posts regarding these methods and I have finally worked out that PopulateValues requires a 2-dimensional array as a datasource. I''m still having trouble with PopulateHeaders though. It appears to accept a 1-dimensional array. When I pass it such an array only the first column header is populated with the text ''Value''. What am I doing wrong? Here is my code: private GridControl grdTransactions; string[] headers ={"trans","count","min","max","mean"}; grdTransactions.Cols.Hidden[0] = true; grdTransactions.Rows.Hidden[0] = true; grdTransactions.Rows.HeaderCount = 1; grdTransactions.ColCount = 5; grdTransactions.PopulateHeaders(GridRangeInfo.Cells(1,1,1,5), headers);

Administrator [Syncfusion]
Replied On July 2, 2004 12:44 PM UTC

The PopulateHeaders will not handle setting values in column headers. You can use code like this to set values in the headers without triggering events.
string[] headers ={"trans","count","min","max","mean"};
int row = 1;
int col = 1;
foreach(string s in headers)
	GridStyleInfo style = new GridStyleInfo();
	style.Text = s;
	this.gridControl1.SetCellInfo(row, col, style, Syncfusion.Styles.StyleModifyType.Override, true, false); 


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

Live Chat Icon For mobile
Live Chat Icon