473,657 Members | 2,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TextBox inside a DataGrid

Hi

I have a datagrid with a TemplateColumn where I have put inside a TextBox
without databinding with the data source.
The TextBox is used to type a number for each row of the datagrid.
I have set the AutoPostBack property of TextBox to true and I have raise
TextChanged event to make some control on typed number.
When I type a number on one TextBox and click out of control to raise the
event, the method that raise the event is called and the property Text of
the TextBox is correctly set to the typed number, but when the datagrid is
displayed after postback the textbox is empty, it sounds like
EnableViewState doesn't work.
Is this behaviour correct ? if yes is possible to workaround ?

Thanks is advance.

Simon.


Nov 19 '05 #1
1 1455
Are you re-binding the DataGrid during the postback? Perhaps you could show
us the event handler code.

--
Scott
http://www.OdeToCode.com/blogs/scott/
Hi

I have a datagrid with a TemplateColumn where I have put inside a
TextBox
without databinding with the data source.
The TextBox is used to type a number for each row of the datagrid.
I have set the AutoPostBack property of TextBox to true and I have
raise
TextChanged event to make some control on typed number.
When I type a number on one TextBox and click out of control to raise
the
event, the method that raise the event is called and the property
Text of
the TextBox is correctly set to the typed number, but when the
datagrid is
displayed after postback the textbox is empty, it sounds like
EnableViewState doesn't work.
Is this behaviour correct ? if yes is possible to workaround ?
Thanks is advance.

Simon.

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1202
by: jm | last post by:
I have datagrid. Inside the template columms there is a textbox. It has an id. When the textbox wasn't inside the datagrid tags, I could reference with order_id.text = "some text" but all of a sudden, once inside the datagrid tags, I can't use the same statement Any ideas on what is going on here? Thanks.
1
2674
by: Irishmaninusa | last post by:
Hello Everyone, I have a datagrid and have used a text box as way to allow a user to edit items in the grid. My question for you is how is it possible to write code for the text change event of the text box. I want to put in some validation and I don't want to use the validator controls because that seems to validate all controls that they are assoicated with in the grid and that is not the desired effect. If any one could help out...
2
5509
by: donnet | last post by:
Inside my .aspx file, I have a textbox populated with data from a dataset like this: <asp:TextBox text='<%# DataBinder.Eval(Container.DataItem, "Comment")%>' id="CommentText" runat="server" TextMode="MultiLine"></asp:TextBox> </ItemTemplate> </asp:datalist> <asp:button id="EditCommentButton" Text="Edit Comment" Runat="server"></asp:button
1
1726
by: jason | last post by:
I've seen a few posts on this issue, but no clear solutions. I have a mulitiline textbox inside a datagrid. I use TemplateColumn to define as multiline with 3 rows. I have other field types like drop downs that have no issue displaying last values in edit mode with seemingly more complicated code. when I attempt to find my textbox with
0
1387
by: jason | last post by:
Hello everyone. I am trying to write some custom command events into a DataGrid. The command that is currently giving me trouble is an "Add" custom command in the footer of a template column. Question #1: In the Add button Command Event I am trying to access the Text value of the TextBox in the other Footer columns. However, inside the Event, the TextBox.Text values are all empty strings, even if they had data typed into them. Is this a...
2
2974
by: ismaelf | last post by:
i have a textbox in a template column in a datagrid, it displays the initial value of the row, but when i change it remains with the original value (it doesnt get the new value..) i fill the CartTable programmatically with rows from a database binded datagrid.. i cant figure out what is wroooong! hehe thanks for helping here is my code: TABLE CODE (in the page_load): If Session("shop_cart") Is Nothing Then
0
1099
by: dylan180 | last post by:
i have a datagrid that have a coloum name week1 that inside this coloum i have 2 textbox name Qty and Price. When the data grid in the edit mode it will autopostback from the Qty(textbox), after that i'll lost the cursor. It that any way to setfocus to the Qty(textbox) or Price(textbox) after postback...
1
1517
by: preeti13 | last post by:
hey i am trying to put the textbox column inside the datagrid but i don't have any idea how to do that please any one help me with this my code is like this: <asp:datagrid id="garidreason" Width="650px" BorderStyle="Solid" BorderColor="Black" AlternatingItemStyle-BorderStyle="Dotted" Runat="server" AutoGenerateColumns="False"> <Columns> <asp:BoundColumn DataField="nominatedbyfirstname" HeaderText="Nominated...
1
3097
by: CindyH | last post by:
Hi I'm using vs.net 2003. I have a dropdownlist inside a datagrid. I would like to be able to select a value from the dropdownlist and then have a textbox which is also inside the datagrid filled with that value. I'm calling OnSelectedIndexChanged="ddlGridMonth_SelectedIndexChanged" event when an item from the dropdownlist is selected I'm not sure of the code I should be using for this event.
0
8319
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8837
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8612
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7347
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6175
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2739
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.