ASP.net 2.0 Datagrid & Dataview Item DataBound problems

  • Thread starter Thread starter ree321
  • Start date Start date
R

ree321

I tried moving an ASP.net project form 1.1 to 2.0.
But I am having problems with getting the OnItemDataBound function to
run for a datagrid, in 2.0.
It only gets called up if AutoGenerateColumns is set to false.

Is there anyway around this?

Then I tried changing the datagrid to GridView and still I am having
trouble getting the function to run in code behind using:
Sub databoundGeneral(ByVal s As Object, ByVal e As
GridViewRowEventArgs) Handles gridGeneral.RowDataBound

Also trying this using AutogenerateColumns set to True.
 
I tried moving an ASP.net project form 1.1 to 2.0.
But I am having problems with getting the OnItemDataBound function to
run for a datagrid, in 2.0.
It only gets called up if AutoGenerateColumns is set to false.

Is there anyway around this?

Then I tried changing the datagrid to GridView and still I am having
trouble getting the function to run in code behind using:
 Sub databoundGeneral(ByVal s As Object, ByVal e As
GridViewRowEventArgs) Handles gridGeneral.RowDataBound

Also trying this using AutogenerateColumns set to True.

Hi,

Auto Generate Columns nothing to do with it...
Auto Generate Columns will generate columns for you if you set it to
true...

the problem is with data bound...

Grid view of asp.net 2.0 has RowDataBound which is called on Databound
of each row in GridView.
on the other hand DataGrid which is still available with asp.net 20
has ItemDataBound for the same purpose.

To Fire these events you got to call Grids "Databound()" method after
setting the data source,

What is the error you are encountering with can put provide..


Best of luck

Munna
www.munna.shatkotha.com
www.munna.shatkotha.com/blog
www.shatkotha.com
 
Hi,

Auto Generate Columns nothing to do with it...
Auto Generate Columns will generate columns for you if you set it to
true...

the problem is with data bound...

Grid view of asp.net 2.0 has RowDataBound which is called on Databound
of each row in GridView.
on the other hand DataGrid which is still available with asp.net 20
has ItemDataBound for the same purpose.

To Fire these events you got to call Grids "Databound()" method after
setting the data source,

What is the error you are encountering with can put provide..

Best of luck

Munnawww.munna.shatkotha.comwww.munna.shatkotha.com/blogwww.shatkotha.com

I created an new page in the project and it worked fine.

At the end it seemed to be a loose grid1.dispose() call that seemed
to be causing it. Commenting out fixed the problem.

Not sure why it was. The web page inherits another standard webpage
and this page declares the datagrid.

Thanks for your help.
 
Back
Top