1
votes

sir, I Need to put multiline textbox edit in gridview. I am using this:

CSS: GridViewEditRow input[type=text] {width:400px; height:200px}

ASPX:

This is making my edit textbox bigger but not multiline. Please Help. I am not using template feild and using default grid edit/update/delete option.

Please help me how to get multiline textbox edit my modifying the existing code.

2
It's actually a property you set on the control itself. Multiline="True"Chris Hawkes
I am not able to set as multiline=True in Gridview.user2980442
It would help if you posted the markup. But if you are using a boundtextfield, you can convert it to a templatefield and alter the textbox in the edit templateSmeegs
I am Very new to asp.net i am not aware of edit template. if you can help me with what i have it will be great. CSS: .GridViewEditRow input[type=text] {width:400px; height:200px} ASPX: <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" pageindexchanging="GridView1_PageIndexChanging" sorting="GridView1_Sorting" Height="350px" Width="100%" AutoGenerateEditButton="True" onrowcancelingedit="GridView1_RowCancelingEdit" onrowediting="GridView1_RowEditing" onrowupdating="GridView1_RowUpdating" <EditRowStyle CssClass="GridViewEditRow" /> </asp:GridView>user2980442

2 Answers

0
votes

Change TextMode property of the texbox to MutlLine for your textbox

0
votes

From http://forums.asp.net/p/1328818/2661667.aspx:

Using the Gridview SmartTag, choose Edit Columns and select the column that you need to be a multiline textbox. There is a "link" near the OK button that will convert the selected column into a Templatefield. You need to click the link. Then click OK. Now in the Gridview's SmartTag (again) you will see Edit Templates at the bottom of the SmartTag. Click that and then using the DDL find the EditTemplate for the column you just made into a TemplateField.

You will see a regular textbox there. You can select it and change it's properties to be Multiline, and you can set the number of lines. That's it! Next click End Editing to get back to the normal view of the Gridview. When you run the page and Edit a row, the column you were working with will have a multiline textbox. Of course you can also set the width and other items in the properties box as well as the Multiline property

enter image description here