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

PopulateValues with a dataView throws an exception

Thread ID:





6502 Aug 14,2003 01:50 PM UTC Aug 14,2003 04:50 PM UTC WinForms 2
Tags: GridControl
Jonathan Guidry
Asked On August 14, 2003 01:50 PM UTC

I have a gridcontrol (Not databound) that I am trying to populate with the sorted results from a dataview. The control throws a an exception on the call to PopulateValues(). This worked fine on a DataBound Grid. Any ideas? Thanks, Jonathan

Administrator [Syncfusion]
Replied On August 14, 2003 02:36 PM UTC

This code worked OK for me in a button handler to populate a grid from a DataView on a DataTable dt. Can you post a sample showing the problem?
private void button1_Click(object sender, System.EventArgs e)
	DataView dv = new DataView(this.dt, "", "Col1", DataViewRowState.CurrentRows);
	this.gridControl1.RowCount = dv.Count + 1;
	this.gridControl1.ColCount = dv.Table.Columns.Count + 1;
	this.gridControl1.PopulateValues(GridRangeInfo.Cells(1, 1, 
			this.gridControl1.RowCount, this.gridControl1.ColCount) , dv);

Jonathan Guidry
Replied On August 14, 2003 04:50 PM UTC

Thanks! I was missing: this.gridControl1.RowCount = dv.Count + 1; this.gridControl1.ColCount = dv.Table.Columns.Count + 1; Jonathan


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