Is it possible to set the size of text boxes in edit mode ?

  • Thread starter Thread starter Ing. Rajesh Kumar
  • Start date Start date
I

Ing. Rajesh Kumar

Hi everybody
Is it possible to set the size of text boxes when in edit mode ?

Thanks in advance
Raja
 
Well, if you mean width the Textbox has a width property where you can set
the pixel width. If you mean length, there is a MaxLength property.

Is that what you were asking?

--
Eric Marvets
Principal Consultant

the bang project

<shameless self promotion>

Email (e-mail address removed) for Information on Our Architecture and
Mentoring Services

</shameless self promotion>
 
Ing. Rajesh Kumar said:
Hi everybody
Is it possible to set the size of text boxes when in edit mode ?

Thanks in advance
Raja

I guess you mean the edit boxes in a datagrid?

If you want to change their sizes, you'll have to turn AutoGenerateColumns
off,
and add all the editable columns as TemplateColumns.

Something like this:

<asp:datagrid id="DataGrid1" runat="server" AutoGenerateColumns="False" >
<Columns>
<asp:TemplateColumn HeaderText="Name">
<ItemTemplate>
<asp:Label runat="server"
text='<%# DataBinder.Eval(Container,
"DataItem.DataItem.Name") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id="soort" runat="server" Width="320px"
Text='<%# DataBinder.Eval(Container, "DataItem.Name") %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
 
Back
Top