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.
Unfortunately, activation email could not send to your email. Please try again.

PopulateValues with a dataView throws an exception

Thread ID:





6502 Aug 14,2003 09:50 AM Aug 14,2003 12:50 PM Windows Forms 2
Tags: GridControl
Jonathan Guidry
Asked On August 14, 2003 09:50 AM

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 10:36 AM

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 12:50 PM

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.

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.