bind dropdownlist with datasource, it will display automaticaly.
IreshPatel
Posts
-
dropdownlist selectvalue -
getting wrong selectedvalue of gridviewHi I am new to asp.net. I have a problem with gridview.selectedvalue. In my form there are two grid. one is master another is detail. (forget formview whichone is using for insert new master record). Now when first time i am selecting record from master, Detail gridview showing correct record but afterwords gridviewsalesm.selectedvalue giving previous value. here is code. (forget my designing bcz i m new for web developement)
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Sales.aspx.cs" Inherits="Sales" %> <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %> <asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server"> <link href="StyleSheet.css" rel="stylesheet" type="text/css" /> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <table id="tablemain" class="salespage"> <tr > <td >SALES TRANSACTION<asp:Label ID="LabelBrcd" runat="server" Text="Y" Visible="False"></asp:Label> </td> </tr> <tr> <td style="height: 22px"> <asp:Panel ID="PanelBillHeader" runat="server" Height="231px"> <asp:FormView ID="fvBillHeader" runat="server" DataKeyNames="BOOK,VRNO" DataSourceID="odssalesm" Width="842px" BorderStyle="Ridge" BorderWidth="2px" Caption="Bill Detail" CaptionAlign="Top" > <EditItemTemplate> BOOK: <asp:Label ID="BOOKLabel1" runat="server" Text='<%# Eval("BOOK") %>' /> <br /> VRNO: <asp:Label ID="VRNOLabel1" runat="server" Text='<%# Eval("VRNO") %>' /> <br /> VRDATE: <asp:TextBox ID="VRDATETextBox" runat="server" Text='<%# Bind("VRDATE") %>' /> <br /> TYPE: <asp:TextBox ID="TYPETextBox" runat="server" Text='<%# Bind("TYPE") %>' /> <br /> ACCODE: <asp:Tex