Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.0 ASP.NET SQL-Server-2008 , +
<%@ Page Title="BudgetMaster" Language="C#" MasterPageFile="~/AdminMasterPage.master" AutoEventWireup="true" CodeFile="BudgetMaster.aspx.cs" Inherits="BudgetMaster" %>
 
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Contentplaceholder1" Runat="Server">
 
      <table class="box-table-b">
        <tr>
            <td class="style1">
                <br />
         <asp:Label ID="Label1" runat="server" CssClass="HeaderMaster"
                    Text="Budget Master" Font-Bold="True" ForeColor="#003366"
                    Font-Size="Medium"></asp:Label>
   </td>
        </tr>
        <tr>
 
            <td>
 
                &nbsp;</td>
        </tr>
    </table>
            <table class="box-table-c">
 
                 <tr>
            <td align="right">
                &nbsp;</td>
            <td align="justify">
                    <asp:Label ID="lblBNumberH" runat="server" Font-Bold="True" ></asp:Label>
                  </td>
                    </tr>
        <tr>
            <td align="right">
 
                <asp:Label ID="Label12" runat="server" CssClass="LblHeaderMasterText"
                    Text="Budget Type : "></asp:Label>
 
            &nbsp;&nbsp;&nbsp;&nbsp;
 
            </td>
            <td align="left">
                <asp:DropDownList ID="ddlBudgetType" runat="server" AutoPostBack="True">
                </asp:DropDownList>
                 <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="ddlBudgetType"
                    ErrorMessage="Required!" ValidationGroup="vgSave" Font-Bold="True"></asp:RequiredFieldValidator>
 
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </td>
        </tr>
 

             <tr>
            <td align="right">
                <asp:Label ID="Label5" runat="server" CssClass="LblHeaderMasterText"
                    Text="Budget FY : "></asp:Label>
            &nbsp;&nbsp;&nbsp;&nbsp;
            </td>
                 <td align="justify">
                <asp:DropDownList ID="ddlBudgetFY" runat="server" AutoPostBack="True">
                </asp:DropDownList>
            &nbsp;</td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="Label13" runat="server" CssClass="LblHeaderMasterText"
                    Text="Item Category : "></asp:Label>
            &nbsp;&nbsp;&nbsp;&nbsp;
            </td>
            <td align="justify">
                <asp:DropDownList ID="ddlItemCategory" runat="server" AutoPostBack="True">
                </asp:DropDownList>
            &nbsp;&nbsp;&nbsp;
            </td>
        </tr>
 
         <tr>
            <td align="right">
                <asp:Label ID="Label6" runat="server" CssClass="LblHeaderMasterText"
                    Text="Item Description :"></asp:Label>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </td>
            <td align="justify">
                <asp:TextBox ID="txtItemDescription" runat="server" MaxLength="50" Height="20px"
                    Width="166px" TextMode="MultiLine"></asp:TextBox>
                    &nbsp;</td>
                    </tr>
                     <tr>
            <td align="right">
                <asp:Label ID="Label7" runat="server" CssClass="LblHeaderMasterText"
                    Text="Configuration :"></asp:Label>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </td>
            <td align="justify">
                <asp:TextBox ID="txtConfiguration" runat="server" MaxLength="50" Height="20px"
                    Width="167px" TextMode="MultiLine"></asp:TextBox>
                    &nbsp;</td>
                    </tr>
                     <tr>
            <td align="right">
                <asp:Label ID="Label8" runat="server" CssClass="LblHeaderMasterText"
                    Text="Project:"></asp:Label>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </td>
            <td align="justify">
                <asp:TextBox ID="txtProject" runat="server" MaxLength="50" Height="18px"
                    Width="169px"></asp:TextBox>
                    &nbsp;</td>
                    </tr>
                     <tr>
            <td align="right">
                <asp:Label ID="Label9" runat="server" CssClass="LblHeaderMasterText"
                    Text="Quantity :"></asp:Label>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </td>
            <td align="justify">
                <asp:TextBox ID="txtQuantity" runat="server" MaxLength="50" Height="18px"
                    Width="168px"></asp:TextBox>
                    &nbsp;</td>
                    </tr>
              <tr>
            <td align="right">
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Label ID="Label10" runat="server" CssClass="LblHeaderMasterText"
                    Text="Reason For Budgted Cost : "></asp:Label>
            &nbsp;&nbsp;&nbsp;&nbsp;
            </td>
            <td align="justify">
                <asp:DropDownList ID="ddlReasonForBudgetCost" runat="server"
                    AutoPostBack="True">
                </asp:DropDownList>
            &nbsp;</td>
        </tr>
     <tr>
            <td align="right">
                <asp:Label ID="Label11" runat="server" CssClass="LblHeaderMasterText"
                    Text=" Total  Cost   :"></asp:Label>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </td>
            <td align="justify">
                <asp:TextBox ID="txtTotalCost" runat="server" MaxLength="50" Height="20px"
                    Width="168px"></asp:TextBox>
                    &nbsp;</td>
                    </tr>
 
     <tr>
            <td align="right">
                <asp:Label ID="Label14" runat="server" CssClass="LblHeaderMasterText"
                    Text="Remarks   :"></asp:Label>
            </td>
            <td align="justify">
                <asp:TextBox ID="txtRemarks" runat="server" MaxLength="50" Height="20px"
                    Width="168px"></asp:TextBox>
                    </td>
                    </tr>
 
           <tr>
            <td style="text-align:center" colspan="2">
                <br />
               <asp:Button ID="btnSave" runat="server" CssClass="btnGray"
               Text="Save" OnClick="btnsave_Click" />
               &nbsp;&nbsp;&nbsp;
               <asp:Button ID="btnClose" runat="server" CssClass="btnGray"
                         Text="Close" OnClick="btnClose_Click" />
                <br />
     </td>
     </tr>
     </table>
     <table class="box-table-grid">
        <tr>
            <td align="center">
                <asp:GridView ID="gvic" runat="server" AutoGenerateColumns="False"
                    CssClass="GridView" Font-Bold="True" >
                    <Columns>
                        <asp:TemplateField HeaderText="Sr No">
                            <ItemStyle CssClass="GridView" />
                            <HeaderStyle CssClass="GridViewHeader" />
                            <ItemTemplate>
                                <asp:Label ID="lblSrNo" runat="server" Text='<%# Container.DataItemIndex+1 %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Budget Number">
                            <ItemStyle CssClass="GridView" />
                            <HeaderStyle CssClass="GridViewHeader" />
                            <ItemTemplate>
                                <asp:Label ID="lblBudgetNumber" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Budget_Number")%>'>
                                </asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                      <asp:TemplateField HeaderText="Budget Type">
                            <ItemStyle CssClass="GridView" />
                            <HeaderStyle CssClass="GridViewHeader" />
                            <ItemTemplate>
                              <asp:Label ID="lblBudgetTypeCode" runat="server"  Text='<%# DataBinder.Eval(Container, "DataItem.BudgetTypeDef")%>'>
                                </asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField >
                            <ItemStyle CssClass="GridView" />
                            <HeaderStyle CssClass="GridViewHeader" />
                            <ItemTemplate>
                                <asp:Label ID="lblBudgetType" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Budget_Type_Code")%>'>
                                </asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                                <asp:TemplateField HeaderText="Budget FY">
                            <ItemStyle CssClass="GridView" />
                            <HeaderStyle CssClass="GridViewHeader" />
                            <ItemTemplate>
                                <asp:Label ID="lblBudgetFYCode" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.BudgetFYDef")%>'>
                                </asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                          <asp:TemplateField >
                            <ItemStyle CssClass="GridView" />
                            <HeaderStyle CssClass="GridViewHeader" />
                            <ItemTemplate>
                                <asp:Label ID="lblBudgetFY" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Budget_FY_Code")%>'>
                                </asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Item Category">
                            <ItemStyle CssClass="GridView" />
                            <HeaderStyle CssClass="GridViewHeader" />
                            <ItemTemplate>
                                <asp:Label ID="lblItemCategory" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Item_Category")%>'>
                                </asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Item Description">
                            <ItemStyle CssClass="GridView" />
                            <HeaderStyle CssClass="GridViewHeader" />
                            <ItemTemplate>
                                <asp:Label ID="lblItemDescription" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Item_Description")%>'>
                                </asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
 
                        <asp:TemplateField HeaderText="Configuration">
                            <ItemStyle CssClass="GridView" />
                            <HeaderStyle CssClass="GridViewHeader" />
                            <ItemTemplate>
                                <asp:Label ID="lblConfigurations" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Configurations")%>'>
                                </asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
 
                        <asp:TemplateField HeaderText="Project">
                            <ItemStyle CssClass="GridView" />
                            <HeaderStyle CssClass="GridViewHeader" />
                            <ItemTemplate>
                                <asp:Label ID="lblProject" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Project")%>'>
                                </asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Quantity">
                            <ItemStyle CssClass="GridView" />
                            <HeaderStyle CssClass="GridViewHeader" />
                            <ItemTemplate>
                                <asp:Label ID="lblQuantity" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Budgeted_Qty")%>'>
                                </asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Reason For Budgeted Cost">
                            <ItemStyle CssClass="GridView" />
                            <HeaderStyle CssClass="GridViewHeader" />
                            <ItemTemplate>
                                <asp:Label ID="lblReasonForBudgetedCost" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Reason_for_Budgeted_Cost ")%>'>
                                </asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Total Cost">
                            <ItemStyle CssClass="GridView" />
                            <HeaderStyle CssClass="GridViewHeader" />
                            <ItemTemplate>
                             <asp:Label ID="lblTotalcost" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Total_Cost")%>'>
                            </asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
 
                        <asp:TemplateField HeaderText="Remarks">
                            <ItemStyle CssClass="GridView" />
                            <HeaderStyle CssClass="GridViewHeader" />
                            <ItemTemplate>
                             <asp:Label ID="lblRemarks" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Remarks")%>'>
                            </asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemStyle CssClass="GridView" />
                            <HeaderStyle CssClass="GridViewHeader" />
                            <ItemTemplate>
                                <asp:Button ID="btnUpdate" runat="server" CssClass="btnGray" OnClick="btnUpdate_Click"
                                    Text="EDIT" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
               </td>_
        </tr>
    </table>
</asp:Content>
Posted 15-Apr-13 19:59pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

The datasource which you are binding to the gridview gvic dose not contain the column BudgetTypeDef. If you are binding data from database (dataset or datareader) or collection, make sure you have this column/property with same name.
 
<ItemTemplate>
<asp:Label ID="lblBudgetTypeCode" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.BudgetTypeDef")%>'>
</asp:Label>
</ItemTemplate>
  Permalink  
Comments
N@veen.S at 16-Apr-13 1:16am
   
Your correct Prashant but the column name your mentioned is not correct, the column name is "BudgetFYDef". Any way good Answer...
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

The DataSet your binding in to Grid that doesn't contain a column called "BudgetFYDef".
 
please check your DataSet.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

There is no cloumn is coming with name as "BudgetFYDef".
 
Kindly check your select query as well.
 
It might be possible that you forget to set synonym for any column as BudgetFYDef
  Permalink  
Comments
ChauhanSK at 16-Apr-13 7:57am
   
thanx guys

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 6,803
1 Sergey Alexandrovich Kryukov 6,377
2 DamithSL 5,421
3 Manas Bhardwaj 4,841
4 Maciej Los 4,330


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 16 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100