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

Can not PopulateValue on a specific Row?

Thread ID:





9447 Dec 18,2003 07:43 AM UTC Dec 18,2003 09:51 AM UTC WinForms 1
Tags: GridControl
Numan Günes
Asked On December 18, 2003 07:43 AM UTC

My code is this : gridControl1.BeginUpdate(); string[] strArray = new string[]{"a","b","c","d","e","f","g"}; grdiControl1.Model.PopulateValues(GridRangeInfo.Row(1),strArray); gridControl1.EndUpdate(); gridControl1.Refresh(); but in control grid, only populate to cell(1,0) value "a". But I want populate array values to all columns(have 7 columns) of 1st row. how can i do?

Administrator [Syncfusion]
Replied On December 18, 2003 09:51 AM UTC

The PopulateValues method moves down the columns and not across the rows. If you want to use some other loop order, then you can write your own populate method, and access the GridData object directly to gain speed over using indexers directly on the GridControl object. This way, you can control exactly the order your data is processed. Here is a little method that tries to populate a single row with values in a string array (which is what I think your sample code was trying to do.)
private void PopulateRow(int row, string[] strArray)
	//make sure you don''t exceed grid or array bounds
	int count = strArray.GetLength(0);
	if(count >= this.gridControl1.ColCount)
	count = this.gridControl1.ColCount - 1;
	if(count > 0)
		GridData data = this.gridControl1.Data;
		for(int i = 0; i < count; ++i)
			GridStyleInfo style = new GridStyleInfo();
			style.CellValue = strArray[i];
			data[row, i + 1] = style.Store;


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