Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 31st, 2005, 09:28 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default texbox update in Datagrid




I want to display fields into DataGrid like

Id,Name ,Qty.
Qty fld should be displayed in textbox remaing as labels.
If any change in Qty text box , "OnTextChanged" event should fire and want to update the database with changed Qty.

I tried like below but my OntextChanged event is nver fired.Pl help me


code like this

<asp:datagrid id="dg" runat="server" AllowPaging="True" Width="100%" AutoGenerateColumns="False"
                                                                >
                                                                <Columns>

                                                                    <asp:BoundColumn DataField="AssetTypeNameID" HeaderText="ID">
                                                                        <HeaderStyle ForeColor="White"></HeaderStyle>
                                                                    </asp:BoundColumn>
                                                                    <asp:BoundColumn DataField="Name" HeaderText="Name">
                                                                        <HeaderStyle ForeColor="White"></HeaderStyle>
                                                                    </asp:BoundColumn>


                                                                    <asp:TemplateColumn HeaderText="Qty" HeaderStyle-ForeColor="#ffffff">
                                                                        <ItemTemplate>
                                                                            <asp:textbox OnTextChanged ="ChangeQty" Width=30 MaxLength =2 id = "Qty" text='<%# DataBinder.Eval(Container.DataItem, "Qty")%>' Runat =server />
                                                                        </ItemTemplate>
                                                                    </asp:TemplateColumn>
                                                                </Columns>
                                                                <PagerStyle HorizontalAlign="Center" ForeColor="Black" BackColor="#999999" Mode="NumericPages"></PagerStyle>
                                                            </asp:datagrid><BR>



public void ChangeQty(object sender, System.EventArgs e)
        {
            System.Web.UI.WebControls.TextBox ed;
            ed = (System.Web.UI.WebControls.TextBox)sender;
            string v_disporder=ed.Text ;
        }

 
Old June 1st, 2005, 01:46 AM
Registered User
 
Join Date: Dec 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

http://msdn.microsoft.com/library/de...verControl.asp

The above link has a similar example. If ur able to implement post a reply with the chnages you have done to make it work.





Similar Threads
Thread Thread Starter Forum Replies Last Post
datagrid update sumith ASP.NET 1.0 and 1.1 Basics 0 February 9th, 2007 02:14 AM
Datagrid.update() and DataAdapter.Update aarunlal ASP.NET 2.0 Professional 2 February 23rd, 2006 11:41 PM
sending values to texbox hastikeyvan Dreamweaver (all versions) 1 September 27th, 2005 07:59 AM
When to declare variable as texbox or string? method ASP.NET 1.x and 2.0 Application Design 3 May 16th, 2005 03:16 PM
Retrieving value from Datagrid texbox eli2003 ASP.NET 1.0 and 1.1 Basics 2 September 3rd, 2003 03:36 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.