473,657 Members | 2,348 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sortable grid to excel

Is it possible to export an sortable gridview to excel?
When I try I get the following error:

RegisterForEven tValidation can only be called during Render()"

Sep 7 '06 #1
2 1121
I got this working. when i click my export button i set
grd.Allowsortin g = false
and that exported correctly

"CSharpguy" wrote:
Is it possible to export an sortable gridview to excel?
When I try I get the following error:

RegisterForEven tValidation can only be called during Render()"
Sep 7 '06 #2
I don't understand what's going on here. Would someone help me
understand this better.

So in asp.net I have something like this below (vb version):
'---------------------- this part is in the partial page class

Protected Sub snTBx_Load(ByVa l sender As Object, ByVal e As
System.EventArg s)
sender.Text = Me.MakeRandom()
End Sub

'---------------------- (the asp page)
<asp:FormView ID="FormView1" CssClass="signu ptable" runat="server"
DataKeyNames="I D" DataSourceID="S qlDSource"
OnPageIndexChan ging="FormView1 _PageIndexChang ing"
OnInserting="Fo rmView1_ItemIns erting" DefaultMode="In sert"
Width="288px" Height="251px" CellPadding="10 ">
<InsertItemTemp late>
<span class="signupla bel">name:</span><br />
<asp:TextBox ID="nTBx" runat="server" Text='<%#
Bind("name") %>' Width="250px"
AutoCompleteTyp e="FirstName" ></asp:TextBox><br />
<span class="signupla bel">email:</span><br />
<asp:TextBox ID="eTBx" runat="server" Text='<%#
Bind("email") %>' Width="250px"
AutoCompleteTyp e="Email"></asp:TextBox><br />
<asp:TextBox ID="snTBx" runat="server" Text='<%#
Bind("srnumbr") %>' Visible="False" Height="0px"
OnLoad="snTBx_L oad"></asp:TextBox><br />
<asp:Button ID="InsertButto n" runat="server"
CausesValidatio n="true" CommandName="Se lect" Text="Sign me up"
UseSubmitBehavi or="false" OnClick="Insert Button_Click" />
</InsertItemTempl ate>
</asp:FormView>

So I decided to convert that to c#. Everything started working well
until the sender. Anyhow this is how the above converts over to c#

//---------------------- the partial page class
protected void snTBx_Load(obje ct sender, EventArgs e){
sender.Text = this.MakeRandom ();
}
//---------------------- (the asp page)

<asp:FormView ID="FormView1" CssClass="signu ptable" runat="server"
DataKeyNames="I D" DataSourceID="S qlDSource" DefaultMode="In sert"
Width="288px" Height="251px" CellPadding="10 ">
<InsertItemTemp late>
<span class="signupla bel">name:</span><br />
<asp:TextBox ID="nTBx" runat="server" Text='<%#
Bind("name") %>' Width="250px"
AutoCompleteTyp e="FirstName" ></asp:TextBox><br />
<span class="signupla bel">email:</span><br />
<asp:TextBox ID="eTBx" runat="server" Text='<%#
Bind("email") %>' Width="250px"
AutoCompleteTyp e="Email"></asp:TextBox<br />
<asp:TextBox ID="snTBx" runat="server" Text='<%#
Bind("srnumbr") %>' Visible="true" Height="10px"
OnLoad="snTBx_L oad">sadfasdfsa </asp:TextBox><br />
<asp:Button ID="InsertButto n" runat="server"
CausesValidatio n="true" CommandName="Se lect" Text="Sign me up"
UseSubmitBehavi or="false" OnClick="Insert Button_Click" />
</InsertItemTempl ate>
</asp:FormView>
Again it seems that the sender doesn't allow for the text property,
so I thought I could try to page load the information, but I can't
seem to reference it through intellisense. How do you get the items
in the insertitemtempl ate?

Thanks in advance for all your help,

Kelly

Oct 31 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
21556
by: Faiz | last post by:
Dear Experts, We are currently using True DB Grid 7.0 with VB6 on Windows 2000 platform. Our objective is to display Excel like formatted data (in rows and columns), allow users to perform cut/copy and paste operations on the selected range of cells and, lastly to get data entered by the users in different cells for further processing. Now the users report that this grid control is difficult to use and the behaviour(in terms of user...
0
1044
by: Krish | last post by:
Hi, I am trying to implement the following... Drag and drop an Excel sheet into a grid control and the grid should have all the data in it, just like when you drag and drop an excel sheet into excel application. Also I would like to copy paste a range from Excel into a grid control it should do the same.
9
3144
by: Nathan | last post by:
A couple of months ago, I went looking for a .NET grid component with what I thought was pretty simple criteria - I wanted an interface that provided my users with Excel-like data entry capability. My users (mostly scientists) use Excel for just about everything and like how quick and easy it is to manipulte tabular data in Excel. For example, a partial list of data-entry features provided by Excel: - Copy/paste from one cell to many -...
2
2301
by: pmud | last post by:
Hi, I am exporting data from an EDITABLE DATA GRID EXCEL. But the 1st column in data grid is Edit Column. I want to display all columns in Excel except for the Edit column. The following code which I am using allows exporting only from text data from data grid & not from Edit columns which are link buttons. How to leave this column while displaying data from data grid in Excel?
3
4279
by: Wayne | last post by:
I need to make a simple grid in which the user can cut and paste the contents of a region of cells from this simple grid to excel. I thought about ganging a bunch of textboxes (1 textbox = 1 cell) together which would work for me but I cannot cut and paste a collection of cells to excel using this approach. Any ideas where to go next? I know I can buy such a capability and have done so in the past but I would like to write it in...
3
3537
by: TPhelps | last post by:
I have a sample of an unbound (autogeneratecolumns is true) sortable/pagable datagrid that works. I want to change one of the columns to a hyperlink. The examples I find use a bound column. I can get this to work; however, the column header on the datagrid is not a link/sortable. What am I missing? Thanks in advance.
5
1127
by: Grant Merwitz | last post by:
I have a basic object in an array. I bind this class to a gridview. How can i make this class sortable? Here's an example class public class MyClass { public MyClass(classname, classtype)
1
4982
by: =?Utf-8?B?Ym9iYnk=?= | last post by:
I have a Grid View and I want to expoet into Excel. I am using a hyperlink to export the GridView intop Excel. But when I click on link it just shows me java script. It doesn't open Excel sheet. Here is my Code. In HTML <p><asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="javascript:alert('Unable to process request');">Send to
0
8399
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8312
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8504
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8606
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6169
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4159
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2732
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.