Datalist with a summarized field

Discussion in 'ASP .Net Datagrid Control' started by Ed, Jan 7, 2004.

  1. Ed

    Ed Guest

    Hi All,

    I have a datalist control that shows a dataset content from a Sql Server
    database.
    I´d like to show a summarized field (one of the dataset fields) after
    the datalist is loaded.
    How can I do this?, is there any way to do this using the footer
    template ? or some other alternative ?

    tks
    Ed
     
    Ed, Jan 7, 2004
    #1
    1. Advertising

  2. Hi Ed,

    The footer sounds like a good place for that. You can insert most any text
    you want. Just drop a label control into the footer in design view and then
    jam in the text value (from the database) on the ItemDataBound event as
    shown below:

    Private Sub DataList1_ItemDataBound _
    (ByVal sender As Object, _
    ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) _
    Handles DataList1.ItemDataBound
    Dim lblNew As Label
    If e.Item.ItemType = ListItemType.Footer Then
    lblNew = e.Item.FindControl("Label1")
    lblNew.Text = "SQL data value here: " & Now.ToString
    End If
    End Sub

    Ken

    "Ed" <> wrote in message
    news:...
    > Hi All,
    >
    > I have a datalist control that shows a dataset content from a Sql
    > Server
    > database.
    > I´d like to show a summarized field (one of the dataset fields) after
    > the datalist is loaded.
    > How can I do this?, is there any way to do this using the footer
    > template ? or some other alternative ?
    >
    > tks
    > Ed
    >
    >
    >
     
    Ken Cox [Microsoft MVP], Jan 9, 2004
    #2
    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. Steve Chen
    Replies:
    0
    Views:
    298
    Steve Chen
    Nov 26, 2003
  2. Steve Chen
    Replies:
    0
    Views:
    294
    Steve Chen
    Dec 8, 2003
  3. Steve Chen

    web search with summarized result/web pages

    Steve Chen, Nov 26, 2003, in forum: C Programming
    Replies:
    1
    Views:
    336
    Irrwahn Grausewitz
    Nov 26, 2003
  4. Rama Vadakattu
    Replies:
    1
    Views:
    267
    Peter Otten
    Mar 24, 2009
  5. Robert Feldt

    Nested struct alignment summarized

    Robert Feldt, Sep 11, 2003, in forum: Ruby
    Replies:
    2
    Views:
    177
    Robert Feldt
    Sep 11, 2003
Loading...

Share This Page