repeater.bind() ?

Posted on 2007-08-06
Last Modified: 2008-02-01
I have a datagrid on my page, this datagrid acts as an edit/delete for some table data.
The table data just happens to be the data that populates a repeater (and in turn a marquee tag) at the foot of the page. Problem is that when the datagrid is edited or a row deleted the repeater data does not refresh of re-bind() and I can't seem to find an event to achieve this. The datagrid code is pretty standard. The code for the repeater is....

<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
<marquee id="Marquee1" runat="server" ><%# Eval("NoticeText") %></marquee>
Question by:QPR
    LVL 18

    Accepted Solution

    after updating data in the datagrid use this
    it will rebind the data, and the values will be refreshed

    LVL 14

    Expert Comment

    When you delete a record or update a row , you are calling datagrid update and delete events.
    What you have to do as suggested by ajaysharmaapjs you have to reinitialize the DataSource Property of the Repeater control and bind it.

    Hope it helps
    LVL 29

    Author Comment

    Having a strange problem,
    Opened the code behind and added this....
    Public Sub gridview1_RowUpdated(ByVal sender As Object, ByVal e As System.EventArgs)
            Repeater1.DataSource = SqlDataSource1
        End Sub

    but I get the message that Repeater1 and SqlDatasource1 are not declared
    LVL 29

    Author Comment

    ok I'm getting there, I had the inherits attribute wrong in the aspx page.

    When I launch the page their is no marquee (so I'm guessingit is no longer bound when the page loads) so I put this in the code behind (below) but now I don't get the marquee onpage load or after the gridview has been updated. In other words it's gone!

    Partial Class Admin_NoticeAdmin
        Inherits System.Web.UI.Page

        Public Sub gridview1_RowUpdated(ByVal sender As Object, ByVal e As System.EventArgs)
            Repeater1.DataSource = SqlDataSource1
        End Sub

        Protected Sub body_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles body.Load
        End Sub
    End Class

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now