ASP.net 2.0 Datagrid & Dataview Item DataBound problems

Discussion in 'ASP .Net' started by ree321, Jun 23, 2008.

  1. ree321

    ree321 Guest

    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.
     
    ree321, Jun 23, 2008
    #1
    1. Advertising

  2. ree321

    Munna Guest

    Re: ASP.net 2.0 Datagrid & Dataview Item DataBound problems

    On Jun 23, 9:51 am, ree321 <> wrote:
    > 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
     
    Munna, Jun 23, 2008
    #2
    1. Advertising

  3. ree321

    ree321 Guest

    Re: ASP.net 2.0 Datagrid & Dataview Item DataBound problems

    On Jun 23, 2:39 pm, Munna <> wrote:
    > On Jun 23, 9:51 am, ree321 <> wrote:
    >
    > > 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
    >
    > 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.
     
    ree321, Jun 24, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?ZW5yaXF1ZQ==?=

    retrieve item dataset/dataview

    =?Utf-8?B?ZW5yaXF1ZQ==?=, Mar 29, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    2,159
  2. Elmo Watson

    Row Item in DataView - OnRowDatabound event

    Elmo Watson, Nov 9, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    3,058
    Alvin Bruney [MVP]
    Nov 11, 2006
  3. CodeMonkey
    Replies:
    1
    Views:
    768
    joyal jhaveri
    Feb 4, 2011
  4. rodchar
    Replies:
    0
    Views:
    409
    rodchar
    Nov 26, 2007
  5. Manu
    Replies:
    0
    Views:
    187
Loading...

Share This Page