Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi All,


i use GridView and i use template field for add textboxes to enter data into gridview.in second time i try to add another data into grid view withing textboxes in template field.but in that second time when load previous data into grid view using data source.that data source contain all data.but problem is grid view display that data without templet field.please tell me any one can how i view data in template field from the data Source.
Posted
Comments
[no name] 10-Sep-13 2:55am    
where is your design code and Query also?
me.ajaykumar 10-Sep-13 2:55am    
using template fields and having textbox in Item Template
http://msdn.microsoft.com/en-us/library/bb288032.aspx

1 solution

try this, it may help you.
XML
<asp:TemplateField ShowHeader="true" HeaderText="Status" >
<ItemTemplate>  <asp:Label ID="lblStatus" runat="server" CausesValidation="false"  CssClass="txt" Text='<%# Bind("status") %>'></asp:Label></ItemTemplate>
</asp:TemplateField>


and ur query like this..
C#
string strQry = "Select complain_date,complain_no,pno, problem, pcno, status from call_log where status NOT LIKE('closed') order by complain_date";
            GlobalDs = GlobalConectionClass.ExecuteDataSet(strQry);
            if (GlobalDs.Tables[0].Rows.Count > 0)
            {
                GridCall.DataSource = GlobalDs.Tables[0].DefaultView;
                GridCall.DataBind();

            }
            GlobalDs.Dispose();
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900