Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 10th, 2007, 10:02 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

The RowCreated event occurs after the RowDataBound event, that is how you are able to work with your data here.

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET

Professional IIS 7 and ASP.NET Integrated Programming

================================================== =========
 
Old August 10th, 2007, 10:31 PM
Authorized User
 
Join Date: Aug 2007
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Magi
Default

I am sorry ,but I should state why I asked the above question.It was because I see some statement
int the <<ASP.NET 2.0 MVP Hacks and Tips>> book.In the section "Adding Client-Side Script to the GridView Control"
of chapter 7.It says these words:

Quote:
quote:
Code:
You can't use RowCreated to add a client-side script to the GridView control to get the value 
from a column located in the selected row because the created row's cells haven't been data-bound 
when the event is triggered. Instead, use the RowDataBound event. The following example gets 
the value from the second cell of a row when the row is selected by pressing the left 
mouse button on a row:

    void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.Cells != null && e.Row.Cells.Count > 1)
        {
            e.Row.Attributes.Add("onClick", "alert('Selected value: " +
    e.Row.Cells[1].Text + "')");
        }
    }
So now I am completely confuse.could you explain it more clear for me?
Thanks.

------------------------------------------------------------------------
We learn from the history that we do not learn from the history





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error 50290: VBA in Excel 2003 doing strange thing Andraw Pro VB 6 0 October 29th, 2008 08:44 AM
About CSS Chapter 5 the <thing> + <thing> {} part thenetduck BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 0 February 7th, 2007 03:45 AM
Eight chapter - very strange things happening marjan BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 2 May 1st, 2004 06:32 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.