473,397 Members | 1,961 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,397 software developers and data experts.

Unable to find control in Gridview

parshupooja
159 100+
Hey All,
I have where I want to do some manipulations and show in other column but unable to find their values in RowDatabound event even though I have two records in gridview
Expand|Select|Wrap|Line Numbers
  1. <asp:GridView ID="GridView1" runat="server" ShowFooter="True" AutoGenerateColumns="false" Width="700px">
  2.         <Columns>
  3.                      <asp:TemplateField HeaderText="Qty">
  4.                         <EditItemTemplate>
  5.                             <asp:TextBox ID="TextBoxCode" runat="server" Width="20pt" Text='<%# Bind("Qty") %>'/>
  6.                         </EditItemTemplate>
  7.                         <ItemTemplate>
  8.                             <asp:Label ID="lblQty" runat="server" Text='<%# Eval("Qty") %>' />
  9.                         </ItemTemplate>
  10.                         <FooterTemplate>
  11.                             <asp:TextBox ID="TextQTY" runat="server" Width="20pt" Text='<%# Bind("Qty") %>'/>
  12.                         </FooterTemplate>
  13.                     </asp:TemplateField>                                
  14.                      <asp:TemplateField HeaderText="Unit Price">
  15.                       <EditItemTemplate>                            
  16.                         </EditItemTemplate>
  17.                         <ItemTemplate>
  18.                             <asp:Label ID="lblUnitCost" runat="server" Text='<%# Eval("UnitCost") %>' />
  19.                         </ItemTemplate>
  20.                         <FooterTemplate>
  21.                             <asp:Label ID="lblfooterUnitCost" runat="server" Text='<%# Eval("UnitCost") %>'/>
  22.                         </FooterTemplate>
  23.                     </asp:TemplateField>
  24.  <asp:TemplateField HeaderText="Line Total">
  25.                       <EditItemTemplate>
  26.  
  27.                         </EditItemTemplate>
  28.                         <ItemTemplate>
  29.                             <asp:Label ID="lbllinettl" runat="server" Text="" />
  30.                         </ItemTemplate>
  31.                         <FooterTemplate>
  32.                             <asp:Label ID="lblfooterLinePrice" runat="server" Text=""/>
  33.                         </FooterTemplate>
  34.                     </asp:TemplateField>
  35.                 </Columns>
  36.         </asp:GridView>     
  37.  
I want to do some calculations in gridview that is lbllinettl = lblUnitCost * lblQty
Here is my RowDAtaBound Event. I don't know why Qty is coming up blank

Expand|Select|Wrap|Line Numbers
  1. Protected Sub GridView1_RowDataBound(ByVal sender As Object,        If (e.Row.RowType = DataControlRowType.DataRow) Then ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
  2.  
  3.             Dim Qty As String
  4.             Qty = CType(e.Row.FindControl("lblQty"), Label).Text
  5.         End If
  6. end Sub
Thanks, Help appreciated
Jun 28 '09 #1
0 4157

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
3
by: Dabbler | last post by:
I have a checkbox control in a GridView EditItemTemplate. My SqlDataAdapter complains when I try and use UpdateCommand Thanks on any binding clarification. GridView: <asp:TemplateField...
2
by: Sean | last post by:
I am using a GridView to display and edit rows of data. I am having problems with one of my GridViews that has a Calendar control in it. If the data coming back from the DB doesn't have a date for...
4
by: Wannabe | last post by:
I am using ASP.Net 2.0 and have a gridview on my page. I have everything working except the delete command. The page reloads except the row I am trying to delete is still there. I believe it is...
1
by: sheenaa | last post by:
Hello Members, I m creating my application forms in ASP.Net 2005 C# using the backend SQL Server 2005. What i have used on forms :: ? On my first form i have used some...
2
by: =?Utf-8?B?Q2FybG8gTWFyY2hlc29uaQ==?= | last post by:
I am building a GridView dynamically adding templatFields according to a Microsoft article. I had to create a class with the ITemplate interface and a method called InstantiateIn. Everything works...
5
by: Tim Mackey | last post by:
hi, with a derived DataGrid control, i can override the CreateColumnSet method and scan into the DataGridColumns and set the DataFormatString, e.g. leave out the time part of a DateTime value. ...
3
by: kimbred | last post by:
Can someone help? I have the code below in which I'm attempting to show or hide the edit control in a gridview based on the value of a column in that view. It doesn't seem to find the control. ...
1
by: abhi83 | last post by:
Hi , I have a problem hope someone can help. I have created a dynamic view which contains a gridview. This gridview contains a check box column in the Template Field with the help of ITemplate...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.