How to set the size of a edit-column in a datagrid

T

Tomas

Hi

I'm trying to set the size of the textbox that appears when clicking the
edit-button in a datagrid, but I'cant find out how to do it.

// Tomas
 
R

Renato Neves

The textbox control don't have "size"! Try "width='70%'", for example.
Note that the EditTemplate have to include the "width='100%'" to apply the
width of the textbox.

Renato.
 
T

Tomas

Thanks for your all of those who helped me! My solution was this (C#):

In dataGrid_ItemCreated:

TextBox tbx = new TextBox();

tbx = (System.Web.UI.WebControls.TextBox)e.Item.Cells.Controls[0];

tbx.Width = Unit.Pixel(75);

tbx.Height = Unit.Pixel(16);

tbx.Font.Name = "Verdana";

tbx.Font.Size = FontUnit.XXSmall;



i is the column index.

This is probably not the best solution but it works for me

// Tomas
 

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
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top