473,385 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

DataGridView editing problem

I've been away from web programming for a while and I have a situation that's
new to me. I'm using VB/Dot Net 2.0.

I've created an xsd (dataset) in the project and dragged some fields from a
table into it. This query is intended as readonly. I've already
successfully bound a datagridview to the query using an Object Data Source.
The query result can easily return several hundred records so paging is
enabled.

As I said, the query itself is intended as readonly. I want to display the
grid results with some additional fields for later use. For starters I want
each column to have a 'select' checkbox (actually there'll be several later)
and I want the check box to retain it's value as the user pages through the
grid.

What I've done so far is to create a dummy field in the query itself:
Select <some fields>, 0 as Issue. I then set the 'Issue' column to
ReadOnly=False, Data Type = boolean and default value = False.

I then created a template column in the DataGridView and put a checkbox
control in the ItemTemplate, and bound it to the 'Issue' column'.

So my problem is this: The check box column displays ok but it will not
retain it's value as I page through the dataset. (i.e. Check a box in page
1, page to page 2, select page 1 again, and the check's gone)

What am I doing wrong? (And should I be using some other technique?)
Oct 16 '08 #1
1 1836
Sorry. Ignore previous post. Just the usual confusion when suddenly
shifting gears from WinForms to WebForms. Obviously just a matter of
sticking some stuff in Session.

"B. Chernick" wrote:
I've been away from web programming for a while and I have a situation that's
new to me. I'm using VB/Dot Net 2.0.

I've created an xsd (dataset) in the project and dragged some fields from a
table into it. This query is intended as readonly. I've already
successfully bound a datagridview to the query using an Object Data Source.
The query result can easily return several hundred records so paging is
enabled.

As I said, the query itself is intended as readonly. I want to display the
grid results with some additional fields for later use. For starters I want
each column to have a 'select' checkbox (actually there'll be several later)
and I want the check box to retain it's value as the user pages through the
grid.

What I've done so far is to create a dummy field in the query itself:
Select <some fields>, 0 as Issue. I then set the 'Issue' column to
ReadOnly=False, Data Type = boolean and default value = False.

I then created a template column in the DataGridView and put a checkbox
control in the ItemTemplate, and bound it to the 'Issue' column'.

So my problem is this: The check box column displays ok but it will not
retain it's value as I page through the dataset. (i.e. Check a box in page
1, page to page 2, select page 1 again, and the check's gone)

What am I doing wrong? (And should I be using some other technique?)
Oct 17 '08 #2

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

Similar topics

4
by: Aaron Smith | last post by:
Ok, this is an odd one, but I could use some assistance with the framework 2 in VB.Net... I want to have a DataGridViewColumn, only have it use the ComboBox, then when they drop down the...
8
by: George | last post by:
Hi, I have been trying to see if I can do the following: 1. Create a DataGridView 2. Create 2 columns in the DataGridView (1 textbox and the other combobox) 3. Create a DataTable containing...
0
by: stevenhaochen | last post by:
I add a user control (a simple textbox control) to customize datagridview column to test how to add user control to datagridview. I found a weired behavior. I can not input "q", "!", "#". But I...
2
by: news.microsoft.com | last post by:
Hi guys, I have a problem with the DataGridView. I want to catch the value of a cell when the user is editing it. Actually, I can't figure if there is an event or a property to get this value. ...
130
by: Daniel Manes | last post by:
I'm baffled. I have a column in a SQL Server Express database called "Longitude," which is a float. When I view the table in a DataGridView, some of the numbers, which only have two decimal places...
5
by: DanThMan | last post by:
The situation: * I have a ButtonColumn in a DataGridView. * When the user preses one of the buttons, a dialog appears. * Based on what the user selects in the dialog, data is entered...
4
by: craig.wenger | last post by:
I am using a DataGridView to display information stored in classes. I am linking to the information with the Tag property of the DataGridView rows. Unfortunately, whenever I set the Tag property,...
0
by: =?Utf-8?B?aW1yYW4uYQ==?= | last post by:
Hi all, I am having a problem with inserting rows in to my datagridview control. The datagridview is bound to a bindingsource with a filter set. If i try and add a row to the datagridview while...
0
by: priyamtheone | last post by:
I'm trying to make a datagridview column to act like a datetimepicker column (C#.Net 2005). These are the behaviours that the dgv should have: 1) Initially all the cells of the dtp column should be...
0
by: priyamtheone | last post by:
I have a datagridview with a button column as one of its column collection. The width of the button column is say 50 but the problem is the button editing control within the cell of that column is...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.