No ItemDataBound event in DataGridView - help!

  • Thread starter Thread starter teddysnips
  • Start date Start date
T

teddysnips

I come from a VB background and I'm on my first C# project.

I have a panel with a DataGridView control. When the program is first
run, the panel is instantiated with 4,000 empty rows (this is a
business requirement. Trust me.)

At some time in the life of the program the user will attempt to load
some data into the grid from a file. The grid will be populated by
this line:

grdFill.DataSource = m_data.FillRows;

m_data.FillRows represents an array of objects of type FillData.

What I would like to do is to validate every row *as it is loaded* and
present the user with a summary of any invalid rows (the sole
criterion for validity is currently whether the value in a particular
cell exceeds a maximum value stored elsewhere).

In VB/ASP using a System.Web.UI.WebControls.DataGrid there was an
ItemDataBound event that fired for every new row.

Does anyone have any ideas/workarounds for my C#/Windows forms
problem?

Thanks

Edward
 
I come from a VB background and I'm on my first C# project.

I have a panel with aDataGridViewcontrol. When the program is first
run, the panel is instantiated with 4,000 empty rows (this is a
business requirement. Trust me.)

At some time in the life of the program the user will attempt to load
some data into the grid from a file. The grid will be populated by
this line:

grdFill.DataSource = m_data.FillRows;

m_data.FillRows represents an array of objects of type FillData.

What I would like to do is to validate every row *as it is loaded* and
present the user with a summary of any invalid rows (the sole
criterion for validity is currently whether the value in a particular
cell exceeds a maximum value stored elsewhere).

In VB/ASP using a System.Web.UI.WebControls.DataGrid there was anItemDataBoundevent that fired for every new row.

Does anyone have any ideas/workarounds for my C#/Windows forms
problem?

Thanks

Edward

Hi,

use DataRowBound event instead
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top