?
Solved

change <EditItemTemplate>'s text box width???

Posted on 2004-08-30
3
Medium Priority
?
281 Views
Last Modified: 2008-03-17
I have a datagrid with edit/update/cancel template. The datagrid has autogeneratecolumn property set. The only one template columns are edit and delete link buttons. When pressing Edit, the edit text boxes appears. However, those edit boxes make my table too big. I would just like to change the witdh of those edit text boxes. Would it be that possible to do and how. I appriciate greatly any help . Here are my codes..
Thanks..
<asp:datagrid id="XmlDataGrid" runat="server" BorderColor="#999999" BorderStyle="None" BorderWidth="1px"
                                                                              BackColor="White" CellPadding="3" GridLines="Vertical" AllowSorting="True" OnSortCommand="SortGrid"
                                                                              OnDeleteCommand="doDelete" OnEditCommand="doEdit" OnCancelCommand="doCancel" OnUpdateCommand="doUpdate">
                                                                              <SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#008A8C"></SelectedItemStyle>
                                                                              <AlternatingItemStyle BackColor="Gainsboro"></AlternatingItemStyle>
                                                                              <ItemStyle ForeColor="Black" BackColor="#EEEEEE"></ItemStyle>
                                                                              <HeaderStyle Font-Bold="True" HorizontalAlign="Center" ForeColor="White" BackColor="#000084"></HeaderStyle>
                                                                              <FooterStyle ForeColor="Black" BackColor="#CCCCCC"></FooterStyle>
                                                                              <Columns>
                                                                                    <asp:TemplateColumn>
                                                                                          <ItemTemplate>
                                                                                                <asp:LinkButton runat="server" Text="Edit" CommandName="Edit" CausesValidation="false"></asp:LinkButton>
                                                                                          </ItemTemplate>
                                                                                          <EditItemTemplate>
                                                                                                <asp:LinkButton runat="server" Text="Update" CommandName="Update"></asp:LinkButton>&nbsp;
                                                                                                <asp:LinkButton runat="server" Text="Cancel" CommandName="Cancel" CausesValidation="false"></asp:LinkButton>
                                                                                          </EditItemTemplate>
                                                                                    </asp:TemplateColumn>
                                                                                    <asp:TemplateColumn HeaderText="Delete">
                                                                                          <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                                                          <ItemTemplate>
                                                                                                <asp:LinkButton Runat="server" Text="Delete" CommandName="Delete" ID="Linkbutton1" NAME="Linkbutton1"></asp:LinkButton>
                                                                                          </ItemTemplate>
                                                                                    </asp:TemplateColumn>
                                                                              </Columns>
                                                                        </asp:datagrid>
0
Comment
Question by:Carl3003
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 17

Accepted Solution

by:
AerosSaga earned 500 total points
ID: 11934698
In order to to contro the width I think you will need to create the columns on your own instead of letting VS do it for you.

Regards,

Aeros
0
 
LVL 10

Expert Comment

by:jnhorst
ID: 11936113
Agreed. Create the columns manually and set their widths however you want them.  You will have to create the EditItemTemplates for each, and this means adding a textbox for each.  Give the textbox an id and set the width property to "100%".  This will make the textbox fill whatever width you gave to the template column.

John
0
 

Author Comment

by:Carl3003
ID: 11942595
I have tried this way, it works very well;however, i am adding programatically datacolumns to the dataset and if i use manual EditItemtemplate for each just added column i have to manually add a new EditItemTemplate. IF i use autogenaratecolumns property i dont have to add manually new columns.But thanks any way. I wil try to go around.
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question