By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,079 Members | 915 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,079 IT Pros & Developers. It's quick & easy.

Editing in GridViews (formatting!)

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.