Home All Groups Group Topic Archive Search About

How to alert to GridView

Author
5 Apr 2006 6:38 AM
ad
I use a GridView to connection to a TableAdapter by a ObjectDataSource

and I add a partial calss to the TableAdapter, and add a new update method
like:

-----------------------------------------------------------------------
   public virtual int Update2(int Pred, ..)
        {
            if (Some Conndition)
                  return 0;
            else
                return Update(...)

        }
----------------------------------------------------------------------------

In some condition, it will update no row. How can I alert to the gridview
that no row updated?
I have try
    protected void gvSt_RowUpdated(object sender, GridViewUpdatedEventArgs
e)
    {
        if (e.AffectedRows < 1)
            Label1.Text="®æ¦¡¿ù»~!!";
    }
But the e.AffectedRows  always return -1 whether the row updated or not

AddThis Social Bookmark Button