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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PopulateValues with a dataView throws an exception

Thread ID:

Created:

Updated:

Platform:

Replies:

6502 Aug 14,2003 01:50 PM UTC Aug 14,2003 04:50 PM UTC WinForms 2
loading
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);
	this.gridControl1.Refresh();
}

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

CONFIRMATION

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.

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

;