Customize Textboxes in EditCommandColumns

W

Will Lastname

I am working on an EditCommandColumn for editing/deleting items from a
datagrid. I am wondering if it is possible to specify height, width,
and other various attributes to the textboxes that are generated.

Dim Item As TextBox = CType(e.Item.Cells(3).Controls(0), TextBox)

How would I go about editing that if I wanted, let's say, border solid,
1px, 100px wide, etc..?

Thanks in advance.
 
S

S. Justin Gengo

Will,

You may use the OnItemDatabound Event of the DataGrid to access the text
boxes. As each row's data is bound the OnItemDataBound event will be fired.
Inside of that event you may find each text box control.

I have a code example on my website that will help lead you in the right
direction. The example uses the technique I've described above to make a
DataGrid row clickable. To do so a button column is placed into the datagrid
and within the OnItemDatabound event it is found and referenced the way
you'll need to find and reference your text boxes.

If you go to my website, www.aboutfortunate.com, click the "Code Library"
link at the top of the page, and then use the search box there to search for
"Clickable Grid" or something similar you'll find the example you need.

If you need any further help feel free to respond here and/or to email me.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 

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

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top