Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.††If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 12th, 2007, 07:24 AM
Registered User
 
Join Date: Sep 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to Display an Empty DataGrid on Page Load

I have created a DataGrid to accept inputs in textboxes in two TemplateColumns and display results after concatinating by clicking the concat button and showing the result in the results column. I just want to Display empty grid on Page Load first and accept inputs in textboxes and show Concat buttons. How can I do that? I am new to DataGrid and asp.net eventhandling but not new to programming. Following is the sample HTML that I am using. What should I do in Page_Load method?

<asp:datagrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 288px; POSITION: absolute; TOP: 80px"
                runat="server" BackColor="Silver" ForeColor="Blue" Font-Size="Small" Font-Names="Courier New"
                HorizontalAlign="Center" AutoGenerateColumns="False" BorderColor="Blue" Visible = "True" >
                <EditItemStyle Font-Size="Small" Font-Names="Times New Roman" ForeColor="Red" BackColor="Silver"></EditItemStyle>
                <Columns>
                    <asp:TemplateColumn HeaderText="String1">
                        <EditItemTemplate>
                            <asp:TextBox id=TextBox1 runat="server" AutoPostBack="True">
                            </asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="String2">
                        <EditItemTemplate>
                            <asp:TextBox id=TextBox2 runat="server" AutoPostBack="True">
                            </asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="Concat Buttons">
                        <ItemTemplate>
                            <asp:Button ID="Button1" Runat="server" Text="Concatinate"></asp:Button>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn Visible="False" HeaderText="Result"></asp:TemplateColumn>
                </Columns>
            </asp:datagrid>
Reply With Quote
  #2 (permalink)  
Old September 13th, 2007, 10:00 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,413
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Logically, you can't display an empty grid. What is there to display?

You need to have at least 1 item bound to the grid for anything to show up, this item can result in all the inputs being empty, which would essentially amount to a new item.

What are you going to concat to? Other items in the grid (i.e are you trying to use the grid to build a list of items)?

-Peter
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to display 'Empty data' when fill datase cJeffreywang ASP.NET 2.0 Basics 2 August 28th, 2008 11:57 PM
datagrid does not display next page vhrao ASP.NET 2.0 Basics 9 July 22nd, 2007 12:28 AM
Page Header Printing on Last Empty Page ritag Access 4 November 11th, 2004 11:07 AM



All times are GMT -4. The time now is 12:23 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.