469,623 Members | 951 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

Editing in GridViews (formatting!)

I've got the Gridview going at full speed, and I've enabled editing,
but when I click on the "edit" button, this ugly editing UI comes up.
Well it's not ugly, but it's not great either.

How do I change the font/font size of the text thats being edited?

Thanks in advance,
Amit

Sep 20 '06 #1
1 1714
Hello Amit,

Option #1 - Use the IDE Tools to Modify the EditItemTemplates

The easiest way is to edit the template for your GridView Control.

1. First off, convert your bound columns to template columns.

Edit Columns select your field 'Convert this field into a TemplateField'.

2. Then, on the context [>] menu, click Edit Templates and select the EditItemTemplate
of the column you wish to modify.

From here, you can modify the control (replace text boxes with drop downs,
etc) and the font/formatting of the edit boxes.

Option #2 - Hand coding. :D

You can also hand-type the entries that are generated by the IDE in #1.
They look like below. Notice that I expanded the text box to a fixed size
and applied font formating (the EditItemTemplate), but left the ItemTemplate
alone so the "grid look" remains.

<asp:TemplateField HeaderText="subject_text" SortExpression="subject_text">

<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Font-Bold="True" Font-Names="Bell
MT" Height="47px"
Rows="5" Text='<%# Bind("subject_text") %>' Width="244px"></asp:TextBox>
</EditItemTemplate>

<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("subject_text")
%>'></asp:Label>
</ItemTemplate>

</asp:TemplateField>

Option #3 - Overall formatting on the GridView

In the <asp:GridViewtag, you can add an <EditRowStyletag that applies
formatting and/or CSS to the general "edit row".

Hope this helps!

-David

---
David R. Longnecker
Web Developer

Wichita Public Schools, USD 259

Amit Wrote:
I've got the Gridview going at full speed, and I've enabled editing,
but when I click on the "edit" button, this ugly editing UI comes up.
Well it's not ugly, but it's not great either.

How do I change the font/font size of the text thats being edited?

Thanks in advance,
Amit

Sep 21 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Dan Weeb | last post: by
1 post views Thread by magic | last post: by
4 posts views Thread by Nalaka | last post: by
25 posts views Thread by mdh | last post: by
reply views Thread by bigbrorpi | last post: by
reply views Thread by titia111 | last post: by
reply views Thread by titia111 | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.