dataView1.RowFilter = "FirstName = 'New'" doesn't work

From: Rochelle (anonymous_at_discussions.microsoft.com)
Date: 02/22/04


Date: Sun, 22 Feb 2004 03:33:01 -0800

Hi Jack,

I had the same problem with this one. I believe the
example is incomplete.

You'll notice the Sub DataGrid1_SortCommand actually
never fires if you set a breakpoint on it.

Remedy:-

I added the DataBind to a Page PreRender (See comments on
p241 about PreRender - You need to rebind with the
restricted result set AFTER the click but before the Page
displays.)

    Private Sub Page_PreRender(ByVal sender As Object, _
  ByVal e As System.EventArgs) Handles MyBase.PreRender
        DataGrid1.DataBind()
    End Sub

Remember event order is -
Page Init
page Load
cached events
postback events (button click)
PagePreRender
PageUnload

Are you doing the ITI561 at CSU... you are up to about
the same point as me!

Anyway - hope this helps. I found it good to really
reinforce the Event Orders!!

:0)
Rochelle

>-----Original Message-----
>Dear all,
>
>I am trying the book of "MCSD self-paced training kit",
>at Page 236. The line of
>dataView1.RowFilter = "FirstName= 'New'";
>
>doesn't work.
>
>Although I can set the same filter in the property
>window, and it does work.
>
>Any suggestion on that?
>
>Thank you in advance.
>
>Jack
>.
>