473,623 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Casting Error when reading DataGrid SortExpression

Mo
Hi,

I'm getting an error:
Input string was not in a correct format

This happens when I try to sort a column. It seems that the sort event
handler claims that the sort expression is not in String format, but it is.
Any suggestions would be greatly appreciated

'DATAGRID code:
<asp:DataGrid id="DataGrid1" Font-Name="Arial, Helvetica, Verdana,
sans-serif" Font-Size="10pt" Runat="server" Width="100%"
OnSortCommand=" SortSelection" AllowSorting="T rue"
AutoGenerateCol umns="false" AlternatingItem Style-BackColor="#EEE CD9"
AllowPaging="Tr ue" PageSize="10" OnPageIndexChan ged="dgGetDocs_ Paged">
<Columns>
<asp:HyperLinkC olumn DataNavigateURL Field="FullFile Path"
DataTextField=" FileName" SortExpression= "FileName" HeaderText=" Document #"
Target="_blank" HeaderStyle-BackColor="#285 193"
HeaderStyle-BorderColor="Wh ite" HeaderStyle-BorderStyle="So lid"
HeaderStyle-BorderWidth="1" HeaderStyle-ForeColor="Whit e"
HeaderStyle-Font-Size="10" HeaderStyle-Font-Bold="true"
HeaderStyle-Font-Name="Arial"></asp:HyperLinkCo lumn>
<asp:BoundColum n DataField="DocS ize" SortExpression= "'DocSize'"
HeaderText=" Size (kb)" HeaderStyle-BackColor="#285 193"
HeaderStyle-BorderColor="Wh ite" HeaderStyle-BorderStyle="So lid"
HeaderStyle-BorderWidth="1" HeaderStyle-ForeColor="Whit e"
HeaderStyle-Font-Size="10" HeaderStyle-Font-Bold="true"
HeaderStyle-Font-Name="Arial"></asp:BoundColumn >
<asp:BoundColum n DataField="DocD ate" SortExpression= "'DocDate'"
DataFormatStrin g="{0:dd-MMM-yyyy}" HeaderText=" Date Created"
HeaderStyle-BackColor="#285 193" HeaderStyle-BorderColor="Wh ite"
HeaderStyle-BorderStyle="So lid" HeaderStyle-BorderWidth="1"
HeaderStyle-ForeColor="Whit e" HeaderStyle-Font-Size="10"
HeaderStyle-Font-Bold="true"
HeaderStyle-Font-Name="Arial"></asp:BoundColumn >
<asp:BoundColum n DataField="DocT ype" SortExpression= "'DocType'"
HeaderText=" Document Type" HeaderStyle-BackColor="#285 193"
HeaderStyle-BorderColor="Wh ite" HeaderStyle-BorderStyle="So lid"
HeaderStyle-BorderWidth="1" HeaderStyle-ForeColor="Whit e"
HeaderStyle-Font-Size="10" HeaderStyle-Font-Bold="true"
HeaderStyle-Font-Name="Arial"></asp:BoundColumn >
</Columns>
</asp:DataGrid>
'Event Handler Code:
Sub SortSelection(B yVal sender As Object, ByVal e As
DataGridSortCom mandEventArgs)
BindData(e.Sort Expression)
End Sub
Nov 18 '05 #1
0 1279

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

Similar topics

0
2123
by: Roman | last post by:
I'm trying to create the form which would allow data entry to the Client table, as well as modification and deletion of existing data rows. For some reason the DataGrid part of functionality stops working when I include data entry fields to the form: I click on Delete or Edit inside of DataGrid and get this error: "Error: Object doesn't support this property or method" If I remove data entry fields from the form - DataGrid allows to...
7
2445
by: DC Gringo | last post by:
I have a datagrid that won't sort. The event handler is firing and return label text, just not the sort. Here's my Sub Page_Load and Sub DataGrid1_SortCommand: -------------------- Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here
11
2678
by: Steve Hoyer | last post by:
I am trying to deploy my first asp.net app to our webserver (2K server, IIS 5) My start page comes up and you can get to the subsequent pages that are tied into our sql server (2K). Each page has a datagrid that loads up just fine, but when I click on any link that updates the page, i.e. a column header to sort the database, it returns a 404 error. Any ideas why it works the for the inital load and not on a postback?
3
2156
by: Richard | last post by:
After printing a userlist to a Datagrid i want some names not to be shown. I want to know how i can make a entire datagrid row invisible. I suspect its something with the OnItemDatabound but i am kinda stuck there. but this is basicly what i want. if Username = "Deleted_User" then 'make entire table row invisible. End if
1
1526
by: Sam | last post by:
I successfully created DataGrid with connected environment but how do I perform sum of TotalRBAmount in DataGrid? Coding of ASP.Net 1.1 ------------------------ <form runat="server"> <wmx:SqlDataSourceControl id="SqlDataSourceControl1" runat="server" UpdateCommand="" SelectCommand="SELECT * FROM order
1
1877
by: Sam | last post by:
I successfully created DataGrid with connected environment but how do I perform sum of TotalRBAmount in DataGrid? Coding of ASP.Net 1.1 ------------------------ <form runat="server"> <wmx:SqlDataSourceControl id="SqlDataSourceControl1" runat="server" UpdateCommand="" SelectCommand="SELECT * FROM order
4
1508
by: Joe | last post by:
Hello, I have a datagrid in an nested html table (one table inside of another table) and have set the allowsSorting property to true. I've created in the code-behind a method (Sub - I'm using VB.NET) that handles the SortCommand event of the data grid. I've included the declaration of the Sub below. EnableViewState is set to false; we reload the DataSource each time the page posts. Would anyone know why this DataGrid doesn't sort? ...
2
3435
by: Mike Baugh | last post by:
I am using visual studio 2005 to develop a form using c# I have 3 datagrids on one form. I can set the row color based on a certain value in a column. However this color applies to all 3 datagrida. I would like to set it so that if value of column 3 in datagrid 1 is < 100 set to red, if = 100 set to green if value of column 3 in datagrid 2 is < 90 set to red, if >= 90 set to green if value of column 3 in datagrid 3is < 80 set to red,...
25
4374
by: Blasting Cap | last post by:
I keep getting errors that pop up when I am trying to convert an application from dotnet framework 1.1 to framework 2.0. The old project was saved in sourcesafe from Visual Studio 2003, and I have opened it in Visual Studio 2005. I've cleared up most errors, but have one that beats the heck out of me. I have a page: sales/Item.aspx that has several datagrids in it.
0
8661
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8312
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
8460
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...
0
7132
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6104
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
5559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4067
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
4153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1766
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.