Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply

ASP Net - Grid View Event Not Working on Alternating Rows

 
Thread Tools Search this Thread
Old 12-28-2005, 02:15 AM   #1
Stuart Shay
 
Posts: n/a
Default Grid View Event Not Working on Alternating Rows

Hello All:

I am working on a ASP.NET GridView, I am not sure to correctly define the
condition so Alternating Rows are fired with in the event. My Code only
works on Item Rows in both Normal and Edit State.

protected void gvUserList_RowDataBound(object sender, GridViewRowEventArgs
e)
{

if (e.Row.RowType == DataControlRowType.DataRow && e.Row.RowState ==
DataControlRowState.Normal)
{
}

if( e.Row.RowState == DataControlRowState.Edit)
{
}

}

Thanks
Stuart


  Reply With Quote
Old 12-29-2005, 05:00 AM   #2
Stuart Shay
 
Posts: n/a
Default Re: Grid View Event Not Working on Alternating Rows

I solved the problem would have been nice if MSFT provided this sample in
the documentation for binding a control (dropdown,checklist,etc) in a Edit
Mode for the GridView

if ((e.Row.RowState == (DataControlRowState.Edit |
DataControlRowState.Alternate)) || (e.Row.RowState ==
DataControlRowState.Edit))
{
/* Edit Mode Code Here (DataControlRowState.Edit) */
}
else if (e.Row.RowType == DataControlRowType.DataRow && (e.Row.RowState ==
DataControlRowState.Normal || e.Row.RowState ==
DataControlRowState.Alternate))
{
/* DataRow Mode Code Here (DataControlRowState.Normal) */
}




"Stuart Shay" <> wrote in message
news:OdEC$...
> Hello All:
>
> I am working on a ASP.NET GridView, I am not sure to correctly define the
> condition so Alternating Rows are fired with in the event. My Code only
> works on Item Rows in both Normal and Edit State.
>
> protected void gvUserList_RowDataBound(object sender, GridViewRowEventArgs
> e)
> {
>
> if (e.Row.RowType == DataControlRowType.DataRow && e.Row.RowState ==
> DataControlRowState.Normal)
> {
> }
>
> if( e.Row.RowState == DataControlRowState.Edit)
> {
> }
>
> }
>
> Thanks
> Stuart
>
>



  Reply With Quote
Old 01-08-2008, 10:10 PM   #3
Neil
 
Posts: n/a
Default RE: Grid View Event Not Working on Alternating Rows

Hi.

All I can say is thank you and I totally agree. I have searched the web for examples of how to achive this, but yours is the ownly article I have found.

Many thanks.

Neil

From http://www.developmentnow.com/g/8_20...nating-Rows.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
TRADING FEMALE CELEB INTERVIEWS ON DVD stu DVD Video 1 05-26-2008 08:39 AM
asp.net : custom code to delete data from Grid view (Database) sara_23apr Software 1 06-19-2007 12:08 PM
Grid view in link using C# yogarajan Software 0 05-05-2007 07:28 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47