ASP.net 2.0 Datagrid & Dataview Item DataBound problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ree321

    ASP.net 2.0 Datagrid & Dataview Item DataBound problems

    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 AutoGenerateCol umns 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 databoundGenera l(ByVal s As Object, ByVal e As
    GridViewRowEven tArgs) Handles gridGeneral.Row DataBound

    Also trying this using AutogenerateCol umns set to True.


  • Munna

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

    On Jun 23, 9:51 am, ree321 <ree...@gmail.c omwrote:
    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 AutoGenerateCol umns 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 databoundGenera l(ByVal s As Object, ByVal e As
    GridViewRowEven tArgs) Handles gridGeneral.Row DataBound
    >
    Also trying this using AutogenerateCol umns 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



    Comment

    • ree321

      #3
      Re: ASP.net 2.0 Datagrid &amp; Dataview Item DataBound problems

      On Jun 23, 2:39 pm, Munna <munna...@gmail .comwrote:
      On Jun 23, 9:51 am, ree321 <ree...@gmail.c omwrote:
      >
      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 AutoGenerateCol umns 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 databoundGenera l(ByVal s As Object, ByVal e As
      GridViewRowEven tArgs) Handles gridGeneral.Row DataBound
      >
      Also trying this using AutogenerateCol umns 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.comww w.munna.shatkot ha.com/blogwww.shatkot ha.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.

      Comment

      Working...