473,695 Members | 2,530 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Data Grid - Update Columns

I'm playing around with DataGrids and the Edit columns ability.

I have a text area that can be anywhere from 1-8000 characters.

When I add the edit capabilities to this DataGrid it displays a single line
TextBox.

Is there anyway of getting this textbox to be multi line, and only 450
characters wide?

I've gotten the width using CSS, but can't fingure out how to make it a
"textarea"

Thanks!

/RT
Nov 19 '05 #1
2 1152
Hi Ryan,

Are you using a template column? You should be able to configure a multiline
textbox inside that. You can said the character width using the Columns
attribute. Here's the idea:
<asp:templateco lumn>
<itemtemplate >
<asp:Label id="Label1" runat="server" Text='<%#
DataBinder.Eval (Container, "DataItem.strin gvalue") %>'>
</asp:label>
</itemtemplate>
<edititemtempla te>
<asp:TextBox id="TextBox1" runat="server"
Text='<%# DataBinder.Eval (Container, "DataItem.strin gvalue") %>'
TextMode="Multi Line" Height="55px" Columns="450">
</asp:textbox>
</edititemtemplat e>
</asp:templatecol umn>

Ken
Microsoft MVP [ASP.NET]
"Ryan Ternier" <rt******@icomp asstech.com> wrote in message
news:%2******** *******@TK2MSFT NGP09.phx.gbl.. .
I'm playing around with DataGrids and the Edit columns ability.

I have a text area that can be anywhere from 1-8000 characters.

When I add the edit capabilities to this DataGrid it displays a single
line
TextBox.

Is there anyway of getting this textbox to be multi line, and only 450
characters wide?

I've gotten the width using CSS, but can't fingure out how to make it a
"textarea"

Thanks!

/RT


Nov 19 '05 #2
Thanks Ken!

That worked very well... however, whenever i try to update that field, I
can't find the actual textbox that contains the new data.

in the Cell that contains the Description (what I need the multiline for),
there are 3 controls. 0 being literal, 1 textbox, 2 literal.

I've also tried:

txtDescription = e.Item.FindCont rol("txtDescrip tion")

And that still yeields the original textbox without the modifications I
made.

Any suggestions?

"Ken Cox [Microsoft MVP]" <BA************ @sympatico.ca> wrote in message
news:u6******** ******@TK2MSFTN GP15.phx.gbl...
Hi Ryan,

Are you using a template column? You should be able to configure a multiline textbox inside that. You can said the character width using the Columns
attribute. Here's the idea:
<asp:templateco lumn>
<itemtemplate >
<asp:Label id="Label1" runat="server" Text='<%# DataBinder.Eval (Container, "DataItem.strin gvalue") %>'>
</asp:label>
</itemtemplate>
<edititemtempla te>
<asp:TextBox id="TextBox1" runat="server"
Text='<%# DataBinder.Eval (Container, "DataItem.strin gvalue") %>'
TextMode="Multi Line" Height="55px" Columns="450">
</asp:textbox>
</edititemtemplat e>
</asp:templatecol umn>

Ken
Microsoft MVP [ASP.NET]
"Ryan Ternier" <rt******@icomp asstech.com> wrote in message
news:%2******** *******@TK2MSFT NGP09.phx.gbl.. .
I'm playing around with DataGrids and the Edit columns ability.

I have a text area that can be anywhere from 1-8000 characters.

When I add the edit capabilities to this DataGrid it displays a single
line
TextBox.

Is there anyway of getting this textbox to be multi line, and only 450
characters wide?

I've gotten the width using CSS, but can't fingure out how to make it a
"textarea"

Thanks!

/RT

Nov 19 '05 #3

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

Similar topics

3
1956
by: pmud | last post by:
Hi, I have 4 columns in my sql database table. I added a data adapter , data set & a data grid to view this information. But the data grid is displaying those 4 columns TWICE , i.e in the data grid i see 8 columns. In case this is useful, the primary key is Serial no. which is an identity ....i.e everytime a row is added to the database, it increments by1. Also, when i configured the data adapter, it couldnt Generate the UPDATE &...
1
1540
by: jijo kuruvila | last post by:
actually my code looks like this private void DataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { DataGrid1.Columns.Visible=true; DataGrid1.Columns.Visible=true; TextBox t1=new TextBox(); TextBox t6=new TextBox(); TextBox t7=new TextBox();
2
2501
by: Josef Meile | last post by:
Hi, I'm using a ComboBox, some Textboxes, and a DataGrid to represent a many-to-many relationship between Person and Course. Each time that I change the value in the ComboBox (which for now is the OID of Person), the information of the person matching the selected OID is shown in the Textboxes (Name, Address, id, etc) and the courses this person is taken are shown in a DataGrid (course name, price, etc.). This is working well so far, I...
2
2215
by: Joe Au | last post by:
I follow the Walkthrough documented on Visual Studio to create an editable data grid but it does not work on getting the value of the textbox in the data grid. The code is copied here. I mark "*****" at which the categoryName always get the past value no matter what it has been changed. How do I fix it? Thanks. Joe. Private Sub DataGrid1_UpdateCommand(ByVal source As Object, ByVal e As...
3
2213
by: pmud | last post by:
Hi, I have a web page (asp.net, code:c#). I havean html table with text boxes. Based on the user input , records are displayed in the data grid below it. Now the datagrid has a large no. of columns. & depending on what the user enters, the data grid can grow very large. So to avoid scrolling the whole page, I just want the data grid to be scrollable. For this I used the <div> tags around the data grid, <div...
5
2784
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go to the database to get the next page. Is there a way to use the dataset to allow us to read back and forth in it instead of going back to the database to get it? Thanks,
6
6699
by: Tejpal Garhwal | last post by:
I have datagrid filled with some data rows. At the run time i want know how many total rows are there in the data grid ? Any idea ? Any Suggestions ? Thanks in advance Tej
9
4018
by: Anil Gupte | last post by:
After reading a tutorial and fiddling, I finally got this to work. I can now put two tables created with a DataTable class into a DataRelation. Phew! And it works! Dim tblSliceInfo As New DataTable("SliceInfo") Dim tblSliceRatings As New DataTable("SliceRatings") '.... All the adding datacolumns, datarows, etc. goes here.. DatasetInit.Tables.Add(tblSliceInfo)
7
1590
by: RolfHerbert | last post by:
Hi all, Source code below. I am using an sqldatasorce to populate a datagrid. I am using datakeyIds. I am interested in two keys which I have added to the datakeyids, however if either of the keys is not databound, set to visible=false or readonly=true, they are unavailable as parameters in my update statement.
6
2942
by: insirawali | last post by:
Hi all, I have this problem, i need to know is there a way i cn use the data adapter's update method in this scenario. i have 3 tables as below create table table1{ id1 int identity(1,1) Constraint pk_table1 Primary Key,
0
8582
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
9122
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
9001
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...
1
8860
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6496
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
5841
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();...
0
4587
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3018
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
3
1980
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.