473,325 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

GridView1_RowCreated versus GridView1_RowDataBound

Ben
Hi,

i'm a little bit confused about the events GridView1_RowDataBound and
GridView1_RowCreated.

1) Which is executed first?
2) if i want to fetch the value of a field using this code:
dim a as string
a = e.Row.Cells(2).Text

in which event do i have to do that?

3) there is a dropdownlist in aspx file embebbed in a template like this:
<asp:TemplateField >
<EditItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" >
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>

i want to access it with this code:
dim dd as dropdownlist
dd = e.Row.FindControl("DropDownList1")

in which event do i have to do that?

Thanks
Bob
Jun 27 '08 #1
3 3802
Hi

"1) Which is executed first? .."

rowcreated is execute first... then rowdatabound....

"2) if i want to fetch the value of a field using this code: ... in
which event do i have to do that? "

RowDataBound
3) there is a dropdownlist in aspx file embebbed in a template like
this: ....in which event do i have to do that?

RowDataBound

Thanks

Munna
Jun 27 '08 #2
Ben
ok, thanks

"Munna" <mu******@gmail.comschreef in bericht
news:c2**********************************@25g2000h sx.googlegroups.com...
Hi

"1) Which is executed first? .."

rowcreated is execute first... then rowdatabound....

"2) if i want to fetch the value of a field using this code: ... in
which event do i have to do that? "

RowDataBound
3) there is a dropdownlist in aspx file embebbed in a template like
this: ....in which event do i have to do that?

RowDataBound

Thanks

Munna

Jun 27 '08 #3
Ben
Hi again,

i posted this but no answer, and because it has to do with this topic, maybe
you can solve this:

Can someone explain me why the same code with the event
GridView1_RowDataBound gives this error:

'DropDownList1' has a SelectedValue which is invalid because it does not
exist in the list of items.
Parameter name: value

and not with the event GridView1_RowCreated ?

Thanks
Ben

Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As

System.Web.UI.WebControls.GridViewRowEventArgs) Handles
GridView1.RowDataBound
If (e.Row.RowState And DataControlRowState.Edit) =
DataControlRowState.Edit Then
If e.Row.RowType = DataControlRowType.DataRow Then
Dim dd As DropDownList
Dim i As Integer
Dim z As ListItem
dd = e.Row.FindControl("DropDownList1")
For i = 1 To 20
z = New ListItem(i, i)
dd.Items.Add(z)
Next
End If
End If
End Sub


"Munna" <mu******@gmail.comschreef in bericht
news:c2**********************************@25g2000h sx.googlegroups.com...
Hi

"1) Which is executed first? .."

rowcreated is execute first... then rowdatabound....

"2) if i want to fetch the value of a field using this code: ... in
which event do i have to do that? "

RowDataBound
3) there is a dropdownlist in aspx file embebbed in a template like
this: ....in which event do i have to do that?

RowDataBound

Thanks

Munna

Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Dieter Vanderelst | last post by:
Dear all, I'm currently comparing Python versus Perl to use in a project that involved a lot of text processing. I'm trying to determine what the most efficient language would be for our...
33
by: Joshua D. Drake | last post by:
Hello, I think the below just about says it all: http://www.commandprompt.com/images/mammoth_versus_dolphin_500.jpg Sincerely, Joshua Drake
2
by: Andrew Robinson | last post by:
I need to create a shared static field for use within a number of different classes. Which one should I be using or are they all really the same thing? public class Widget { private Widget() {}...
2
by: Jon Lapham | last post by:
I have a table that stores TEXT information. I need query this table to find *exact* matches to the TEXT... no regular expressions, no LIKE queries, etc. The TEXT could be from 1 to 10000+...
135
by: Xah Lee | last post by:
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about...
1
by: johnpa60 | last post by:
Hello Anyone here has seen any materials on comparing DB2 CM versus Domino Doc Server? Can you please point me? If any of you have worked on both products, can you please spend few minutes...
42
by: John Doty | last post by:
I realized that I have a little job on the table that is a fine test of the Python versus Standard Forth code availability and reusability issue. Note that I have little experience with either...
4
by: aj | last post by:
DB2 8.2 LUW FP14 Is there any real difference between select blahblahblah... where blah IN (select blah......) versus select blahblahblah... where blah = ANY (select blah.....) versus select...
2
by: =?Utf-8?B?TW9vcmUgV29ya3M=?= | last post by:
Howdy All, I don't understand how to correct an error I encounter when trying to control GridView DataBound data flow. error CS0123: No overload for 'GridView2_DataBound' matches delegate...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.