473,791 Members | 2,827 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can you help (editable datagrids)

Hi,

ive been using the following link :-
http://www.dotnetjohn.com/articles.aspx?articleid=21

but i noticed in the code that it only brought back the top 10 records. when
i removed this and brought back all records and added paging via the
property builder i got the following error

*************** *************** *************** *************** **********
AllowCustomPagi ng must be true and VirtualItemCoun t must be set for a
DataGrid with ID dtgCustomers when AllowPaging is set to true and the
selected datasource does not implement ICollection.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.Http Exception: AllowCustomPagi ng must be true
and VirtualItemCoun t must be set for a DataGrid with ID dtgCustomers when
AllowPaging is set to true and the selected datasource does not implement
ICollection.

Source Error:

Line 46: objConn.Open()
Line 47: dtgCustomers.Da taSource = cmdCustomers.Ex ecuteReader()
Line 48: dtgCustomers.Da taBind()
Line 49: objConn.Close()
Line 50: End Sub

*************** *************** *************** *************** **************

im a little bit confused with all this as im a bit of newbie to it all. how
would i get paging to work?

Cheers,
Craig
Nov 18 '05 #1
1 1107
"Craig G" <cr**********@y arrasoftware.co m> wrote in message
news:eK******** ******@TK2MSFTN GP09.phx.gbl...
Hi,

ive been using the following link :-
http://www.dotnetjohn.com/articles.aspx?articleid=21

but i noticed in the code that it only brought back the top 10 records.
when
i removed this and brought back all records and added paging via the
property builder i got the following error

*************** *************** *************** *************** **********
AllowCustomPagi ng must be true and VirtualItemCoun t must be set for a
DataGrid with ID dtgCustomers when AllowPaging is set to true and the
selected datasource does not implement ICollection.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.Http Exception: AllowCustomPagi ng must be
true
and VirtualItemCoun t must be set for a DataGrid with ID dtgCustomers when
AllowPaging is set to true and the selected datasource does not implement
ICollection.

Source Error:

Line 46: objConn.Open()
Line 47: dtgCustomers.Da taSource = cmdCustomers.Ex ecuteReader()
Line 48: dtgCustomers.Da taBind()
Line 49: objConn.Close()
Line 50: End Sub

*************** *************** *************** *************** **************

im a little bit confused with all this as im a bit of newbie to it all.
how
would i get paging to work?


You should look into using a DataSet instead of a DataReader (which you're
getting back from ExecuteReader). I'm afraid I don't have a good link handy,
but you'll find good references on MSDN.

John Saunders
Nov 18 '05 #2

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

Similar topics

0
1632
by: Philip Townsend | last post by:
I have a datagrid that contains a dropdown list that is part of an EditItemTemplate. I need to run some code when the dropdown list builds in order to preselect an item in the list. Preselecting the item is not the problem. The problem is that the dropdown object is not instantiated at the point at which the Edit button is clicked, or at any other obvious step in the process. In other words, when a user clicks the Edit (EditCommand)...
1
1140
by: Brian Conway | last post by:
How can I make an entire datagrid editable upon population (page_load). Basically what I want is the datagrid to come up like a spreadsheet window where that can edit information, and then click on a update button that will loop through and insert each row that was updated.
4
1383
by: sugnaboris | last post by:
Hope someone can help me with a question about this control. I would like to display a list of file names, together with a description for each file. I've done some prototyping, and the ListView seems ideal, at least as far as the presentation of the static inforamation is concerned. However: * the Item is logically the filename (that's akin to the primary key
2
1273
by: Greg | last post by:
Does anyone know of a way to allow a user to click on a cell within a datagrid and then edit the contents of that cell? Nearly all the topics I've come across on Google appear to be for the webform version of the control. However, I'm using a winform one. If it makes any difference, mine is bound to an ArrayList. I've played aound with the click event and beginedit() for quite a while now - so if anyone could give me a tip or too I'd...
0
939
by: sJeev via DotNetMonster.com | last post by:
Please help, I am very new to asp.net and data grids have got me stuck for a loooong time. I can either have the right content in my datagrids or make them editable. In the first case, I make the connection, the adapter, the dataset all in the aspx.cs file. I also make the oledb command there, and it works fine...until I try to edit it. The datagrid I make uses the tool under webforms in the aspx file. I think its because everything...
0
1261
by: Scott Meddows | last post by:
I'm having trouble scrolling some datagrids so they sync up... I have two identical datagrids on a form, filled with eh same dataset. I want a user to be able to scroll on the datasets and the other dataset then scrolls to the same place on the other dataset (bare with me). This is the code that I have so far... Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load...
6
1614
by: Richard L Rosenheim | last post by:
I'm sure it can be done, I haven't been able to find the right article yet. I want to be able to filter the records that the datagrid displays, but still have an editable datagrid. That is, I only want records from the table where "State= 'CA'" are to be displayed, but where the user can still edit/add/delete records. The only examples I have found utilizes DataViews, which apparently are not editable. Can someone point me to the...
4
1359
by: joshlaw | last post by:
Hi! I've got some data that I want to display and edit in table-format, just like you would in Excel. It seems like this should be fairly straightforward, but I can't find any controls that do what I want. The closest one I've found is a ListView, but it will only let me edit the first column of data. What control should I be using? My data is very simple (about 10 ArrayLists, each with 2 strings followed by 2 floats).
2
1940
by: rn5a | last post by:
In a shopping cart app, a ASPX page retrieves the order details & personal details of a user from a MS-Access database table depending upon the username of the user. The order details of a particular order (like ProductID, Name, Description, Quantity etc.) are displayed in one DataGrid where as the personal details of the buyer corresponding to this order (like Name, E-Mail, Shipping & Billing Address etc.) are displayed in another...
4
2628
by: willywongi | last post by:
Hi, I'm trying to build a filemanager for a cms. I'd like to have a page with JS that asks the server for the filelist, which in turn answers with a XML document. This is a sample of the XML answer: <?xml version="1.0" encoding="ISO-8859-15"?> <items tot="1"> <item iid="60dddfb31b978dc4c36d4475211e6672" key="fid" title=" C-nar.jpg"> <node nType="icon" editable="false" key="thumb" width="720" height="576">]</node> <node nType="parent"...
0
9515
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,...
0
10426
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...
0
10207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10154
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,...
1
7537
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
6776
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
5558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4109
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
3
2913
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.