gridview question

G

Guest

i do this in code if you need to do it dynamicly. Try this, i have not tested
this, but it should work. Please let me know.

use the rowediting event to find the text box and then set the width.
Protected Sub GridView1_RowEditing(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewEditEventArgs) Handles GridView1.RowEditing
Dim tb As TextBox =
Me.GridView1.Rows(Me.GridView1.SelectedIndex).Cells(3).FindControl("mytextbox")

tb.Width = 75
End Sub
you need to know the cell number and the name of the text box where your
template field is.
Try this
 
G

Guest

on second pass, I can't get my sode to work eather. Should have tried this
first.
if you do find the answer i would really like to know!
thanks and appologies for the untesed answer
 
J

Jon Paal

it's not a template field it's a bound field.

I resolved the problem by using an external css file setting the html input tag to a specified width.

thanks for trying.
 
J

Jon Paal

thanks for trying

I am using a bound field not a template filed.

I resolved the problem by using an external css file setting the input tag to a specified width
 
G

Guest

for what it's worth you can just set the width of the text box after you
convert it to a template field. It is not dynamic, but it may do what you want
1. convert column to a template
2. select edit templates
3. select the edit template
4. change the width property
thanks
and sorry again about the previous answer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top