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
- <asp:GridView ID="GridView1" runat="server" ShowFooter="True" AutoGenerateColumns="false" Width="700px">
-
<Columns>
-
<asp:TemplateField HeaderText="Qty">
-
<EditItemTemplate>
-
<asp:TextBox ID="TextBoxCode" runat="server" Width="20pt" Text='<%# Bind("Qty") %>'/>
-
</EditItemTemplate>
-
<ItemTemplate>
-
<asp:Label ID="lblQty" runat="server" Text='<%# Eval("Qty") %>' />
-
</ItemTemplate>
-
<FooterTemplate>
-
<asp:TextBox ID="TextQTY" runat="server" Width="20pt" Text='<%# Bind("Qty") %>'/>
-
</FooterTemplate>
-
</asp:TemplateField>
-
<asp:TemplateField HeaderText="Unit Price">
-
<EditItemTemplate>
-
</EditItemTemplate>
-
<ItemTemplate>
-
<asp:Label ID="lblUnitCost" runat="server" Text='<%# Eval("UnitCost") %>' />
-
</ItemTemplate>
-
<FooterTemplate>
-
<asp:Label ID="lblfooterUnitCost" runat="server" Text='<%# Eval("UnitCost") %>'/>
-
</FooterTemplate>
-
</asp:TemplateField>
-
<asp:TemplateField HeaderText="Line Total">
-
<EditItemTemplate>
-
-
</EditItemTemplate>
-
<ItemTemplate>
-
<asp:Label ID="lbllinettl" runat="server" Text="" />
-
</ItemTemplate>
-
<FooterTemplate>
-
<asp:Label ID="lblfooterLinePrice" runat="server" Text=""/>
-
</FooterTemplate>
-
</asp:TemplateField>
-
</Columns>
-
</asp:GridView>
-
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
- 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
-
-
Dim Qty As String
-
Qty = CType(e.Row.FindControl("lblQty"), Label).Text
-
End If
-
end Sub
Thanks, Help appreciated