473,326 Members | 2,175 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,326 software developers and data experts.

GridView & OnRowUpdating & no control from EditItemTemplate


I have the following ASPX:

<asp:GridView ID="ctlAllocations" runat="server"
OnRowEditing="ctlAllocations_OnRowEditing"
OnRowDeleting="ctlAllocations_OnRowDeleting"
OnRowCancelingEdit="ctlAllocations_OnRowCancelingE dit"
OnRowUpdating="ctlAllocations_OnRowUpdating"
OnRowUpdated="ctlAllocations_OnRowUpdated"
OnRowDataBound="ctlAllocations_OnRowDataBound" >
<Columns>
<asp:TemplateField HeaderText="GL Account" >
<ItemTemplate><%# DataBinder.Eval(Container.DataItem,
"gldescr")%></ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="ctlGLAccountInGrid" runat="server"
DataTextField="Descr" DataValueField="Acct"/>
</EditItemTemplate>
<asp:CommandField ShowEditButton=true CausesValidation=false />
This is the handler for OnRowUpdating
Code:
--------------------
protected void ctlAllocations_OnRowUpdating(object sender, GridViewUpdateEventArgs e)
{
DropDownList ctl1 = (DropDownList)ctlAllocations.Rows[e.RowIndex].Cells[0].FindControl("ctlGLAccountInGrid");
}
--------------------
When it is raised ctl1 == null. Why?

--
senglory
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Jun 2 '08 #1
0 1353

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

Similar topics

0
by: Dom | last post by:
Hello This should work I know ... but.. with your help perhaps.. Trying to assign a 'selectparameter' to an objectdatasource nested within a gridview EditItemTemplate. When I try to access...
0
by: den 2005 | last post by:
Hi everybody, I created a Gridview with a TemplateField and there is Label control in ItemTemplate and a DropdownList control in EditItemTemplate, I was to displayed them ok when I click the...
4
by: Tomasz Jastrzebski | last post by:
Hello Everyone, I have a GridView control bound to a plain DataTable object. AutoGenerateEditButton is set to true, Edit button gets displayed, and RowEditing event fires as expected.
5
by: kageyone | last post by:
I am trying to use the .net 2.0 gridview control where I programmatically set the datasource to an xml file read into a dataset. I am able to use the commandfield for the edit button and it puts me...
0
by: ganesh22 | last post by:
Hi... Iam using GridView in asp.net(2.0) .My requirement is user can add,update,delete in gridview I written the code for add & update but can u help adding rows in grid view My code: ...
0
by: KeesH | last post by:
Hi, I am quite desperate now because I made a nice webshop with a gridview where the customer is able to update the amount of products (Hostas in my situation) or delete the row. The problem is...
0
by: senglory | last post by:
I have the following ASPX: <asp:GridView ID="ctlAllocations" runat="server" OnRowEditing="ctlAllocations_OnRowEditing" OnRowDeleting="ctlAllocations_OnRowDeleting"...
2
by: doanthithanhnhan | last post by:
I'm working with GridView. But it seems rough. When I add a Command Field (Edit, Update image button type) handly. The OnRowUpdating doesn't fire when I click on Update button. Then I change by...
5
by: sandhyascs | last post by:
Hi everyone I’m using the GridView in asp.net and populating the grid dynamically using c#.net.To edit the rows i i m using GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)....
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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.