Q: datagrid header/footer

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

    Q: datagrid header/footer

    Hello,
    Is it possible to change a datagrid Header and Footer text in code behind
    dynamically?
    Thanks,
    Jim.

  • Bill Borg

    #2
    RE: Q: datagrid header/footer

    Jim, at ItemDataBound you can get at header and footer, e.g. e.Item.ItemType
    = ListItemType.He ader. From there I'd use findcontrol to get the controls you
    want to modify.

    Bill

    "JIM.H." wrote:
    [color=blue]
    > Hello,
    > Is it possible to change a datagrid Header and Footer text in code behind
    > dynamically?
    > Thanks,
    > Jim.
    >[/color]

    Comment

    • Bill Borg

      #3
      RE: Q: datagrid header/footer

      Jim, at ItemDataBound you can get at header and footer, e.g. e.Item.ItemType
      = ListItemType.He ader. From there I'd use findcontrol to get the controls you
      want to modify.

      Bill

      "JIM.H." wrote:
      [color=blue]
      > Hello,
      > Is it possible to change a datagrid Header and Footer text in code behind
      > dynamically?
      > Thanks,
      > Jim.
      >[/color]

      Comment

      • JIM.H.

        #4
        RE: Q: datagrid header/footer

        I am quite new in this issue, can you give me example or an web page I can
        check?

        "Bill Borg" wrote:
        [color=blue]
        > Jim, at ItemDataBound you can get at header and footer, e.g. e.Item.ItemType
        > = ListItemType.He ader. From there I'd use findcontrol to get the controls you
        > want to modify.
        >
        > Bill
        >
        > "JIM.H." wrote:
        >[color=green]
        > > Hello,
        > > Is it possible to change a datagrid Header and Footer text in code behind
        > > dynamically?
        > > Thanks,
        > > Jim.
        > >[/color][/color]

        Comment

        • JIM.H.

          #5
          RE: Q: datagrid header/footer

          I am quite new in this issue, can you give me example or an web page I can
          check?

          "Bill Borg" wrote:
          [color=blue]
          > Jim, at ItemDataBound you can get at header and footer, e.g. e.Item.ItemType
          > = ListItemType.He ader. From there I'd use findcontrol to get the controls you
          > want to modify.
          >
          > Bill
          >
          > "JIM.H." wrote:
          >[color=green]
          > > Hello,
          > > Is it possible to change a datagrid Header and Footer text in code behind
          > > dynamically?
          > > Thanks,
          > > Jim.
          > >[/color][/color]

          Comment

          • Bill Borg

            #6
            RE: Q: datagrid header/footer

            Jim, some good articles are here:


            (Peter van Ooijen)
            and here:
            http://aspnet.4guysfromrolla.com/articles/040502-1.aspx (Scott Mitchell)

            After you understand the basics, the rest of what you do where depends on a
            few things. Come back with a few specifics--for one, are these template
            columns, and for two, do you know what you want to change the header/footer
            to *before* you load the data in the grid or not till *after*?

            Bill

            "JIM.H." wrote:
            [color=blue]
            > I am quite new in this issue, can you give me example or an web page I can
            > check?
            >
            > "Bill Borg" wrote:
            >[color=green]
            > > Jim, at ItemDataBound you can get at header and footer, e.g. e.Item.ItemType
            > > = ListItemType.He ader. From there I'd use findcontrol to get the controls you
            > > want to modify.
            > >
            > > Bill
            > >
            > > "JIM.H." wrote:
            > >[color=darkred]
            > > > Hello,
            > > > Is it possible to change a datagrid Header and Footer text in code behind
            > > > dynamically?
            > > > Thanks,
            > > > Jim.
            > > >[/color][/color][/color]

            Comment

            • Bill Borg

              #7
              RE: Q: datagrid header/footer

              Jim, some good articles are here:


              (Peter van Ooijen)
              and here:
              http://aspnet.4guysfromrolla.com/articles/040502-1.aspx (Scott Mitchell)

              After you understand the basics, the rest of what you do where depends on a
              few things. Come back with a few specifics--for one, are these template
              columns, and for two, do you know what you want to change the header/footer
              to *before* you load the data in the grid or not till *after*?

              Bill

              "JIM.H." wrote:
              [color=blue]
              > I am quite new in this issue, can you give me example or an web page I can
              > check?
              >
              > "Bill Borg" wrote:
              >[color=green]
              > > Jim, at ItemDataBound you can get at header and footer, e.g. e.Item.ItemType
              > > = ListItemType.He ader. From there I'd use findcontrol to get the controls you
              > > want to modify.
              > >
              > > Bill
              > >
              > > "JIM.H." wrote:
              > >[color=darkred]
              > > > Hello,
              > > > Is it possible to change a datagrid Header and Footer text in code behind
              > > > dynamically?
              > > > Thanks,
              > > > Jim.
              > > >[/color][/color][/color]

              Comment

              • JIM.H.

                #8
                Re: Q: datagrid header/footer

                Thanks Bill for the reply.
                My data grid works fine and I am doing edit/insert/delete kind of
                things, that is way I am looking an easiest way to reach the footer of
                a column and set a text there.

                So I am looking something like
                DataGrid1.Foote r[ColumnName].Text="myText", is this possible?

                Comment

                Working...