473,382 Members | 1,464 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,382 software developers and data experts.

Please help - DataGrid

KB
I realised that if I use datagrid and datasource is a
datatable, when I created a new row and while on that row
I exit the datagrid (ie. without moving into the next
row) and focus onto another control, that new row is not
recorded (check it at the datagrid.validating event).
However, if I use down arrow key to move to the next row
(without keying any data) and exit, the new row is
recorded in the datatable.
can anyone please advise if I can force the datagrid row
into the datatable without moving the arrow key ??

Thank you

AH
Nov 20 '05 #1
4 1257
Good question. I cant find a way of doing this easily, but I am sure that
there is a way. However, I am interested to know why you would want to add
blank rows to your grid ?

OHM

KB wrote:
I realised that if I use datagrid and datasource is a
datatable, when I created a new row and while on that row
I exit the datagrid (ie. without moving into the next
row) and focus onto another control, that new row is not
recorded (check it at the datagrid.validating event).
However, if I use down arrow key to move to the next row
(without keying any data) and exit, the new row is
recorded in the datatable.
can anyone please advise if I can force the datagrid row
into the datatable without moving the arrow key ??

Thank you

AH


Regards - OHM# On**********@BTInternet.com
Nov 20 '05 #2
Maybe there is a way. On the currentCellChanged event, you can compare the
rowIndex with the rows.count on the bound table. If the row is greater, you
could save it at this point.

Worth a try.

OHM
One Handed Man [ OHM# ] wrote:
Good question. I cant find a way of doing this easily, but I am sure
that there is a way. However, I am interested to know why you would
want to add blank rows to your grid ?

OHM

KB wrote:
I realised that if I use datagrid and datasource is a
datatable, when I created a new row and while on that row
I exit the datagrid (ie. without moving into the next
row) and focus onto another control, that new row is not
recorded (check it at the datagrid.validating event).
However, if I use down arrow key to move to the next row
(without keying any data) and exit, the new row is
recorded in the datatable.
can anyone please advise if I can force the datagrid row
into the datatable without moving the arrow key ??

Thank you

AH


Regards - OHM# On**********@BTInternet.com


Regards - OHM# On**********@BTInternet.com
Nov 20 '05 #3
hi, nice to know that I'm not the only one facing this
problem. re 1st question I did not create a blank row. I
actually key in data but cursor did not leave that row. I
realised it does not create that row in datatable until
you actual move the cursor to next row.

yes .. that could work but i believe that must be a
better way ... could any expert care to help? I do a
validating event and the set focus back to grid and next
validating event will create that row into the
datatable ... strange.. therefore I believe there must be
some event or method that can force the record into the
datatable.

Rgds,

AH

-----Original Message-----
Maybe there is a way. On the currentCellChanged event, you can compare therowIndex with the rows.count on the bound table. If the row is greater, youcould save it at this point.

Worth a try.

OHM
One Handed Man [ OHM# ] wrote:
Good question. I cant find a way of doing this easily, but I am sure that there is a way. However, I am interested to know why you would want to add blank rows to your grid ?

OHM

KB wrote:
I realised that if I use datagrid and datasource is a
datatable, when I created a new row and while on that row I exit the datagrid (ie. without moving into the next
row) and focus onto another control, that new row is not recorded (check it at the datagrid.validating event).
However, if I use down arrow key to move to the next row (without keying any data) and exit, the new row is
recorded in the datatable.
can anyone please advise if I can force the datagrid row into the datatable without moving the arrow key ??

Thank you

AH


Regards - OHM# On**********@BTInternet.com


Regards - OHM# On**********@BTInternet.com
.

Nov 20 '05 #4
I wouldnt swear to it, but this may be how it was intended to work !

OHM

an*******@discussions.microsoft.com wrote:
hi, nice to know that I'm not the only one facing this
problem. re 1st question I did not create a blank row. I
actually key in data but cursor did not leave that row. I
realised it does not create that row in datatable until
you actual move the cursor to next row.

yes .. that could work but i believe that must be a
better way ... could any expert care to help? I do a
validating event and the set focus back to grid and next
validating event will create that row into the
datatable ... strange.. therefore I believe there must be
some event or method that can force the record into the
datatable.

Rgds,

AH

-----Original Message-----
Maybe there is a way. On the currentCellChanged event, you can
compare the rowIndex with the rows.count on the bound table. If the
row is greater, you could save it at this point.

Worth a try.

OHM
One Handed Man [ OHM# ] wrote:
Good question. I cant find a way of doing this easily, but I am sure
that there is a way. However, I am interested to know why you would
want to add blank rows to your grid ?

OHM

KB wrote:
I realised that if I use datagrid and datasource is a
datatable, when I created a new row and while on that row
I exit the datagrid (ie. without moving into the next
row) and focus onto another control, that new row is not
recorded (check it at the datagrid.validating event).
However, if I use down arrow key to move to the next row
(without keying any data) and exit, the new row is
recorded in the datatable.
can anyone please advise if I can force the datagrid row
into the datatable without moving the arrow key ??

Thank you

AH

Regards - OHM# On**********@BTInternet.com


Regards - OHM# On**********@BTInternet.com
.


Regards - OHM# On**********@BTInternet.com
Nov 20 '05 #5

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

Similar topics

5
by: Steve M | last post by:
I have subclassed CollectionBase. I have also implemented GetEnumerator(). I have tried to set the DataSource of a DataGrid to an instance of my subclass. However, the items in the grid are not...
0
by: Junkguy | last post by:
I need to be able to tell if the blank row of a DataGrid has been edited or not. In a DataGrid, you may notice that if you click on the asterisk row, the asterisk will change to a triangle, but...
6
by: Teep | last post by:
Below is my code for dropdownlist that is populated from a SQL table. After a selection from the ddl, a datagrid is suppose to come up pertaining to the information selected, but I keep getting a...
4
by: steroche | last post by:
I would REALLY appreciate help please please please! Im sure it is probably blindingly obvious to most of you but I am totally in the dark here!I am lost - i thought i had finally figured out this...
7
by: Juan Romero | last post by:
Hey guys, please HELP I am going nuts with the datagrid control. I cannot get the damn control to refresh. I am using soap to get information from a web service. I have an XML writer output...
6
by: Coleen | last post by:
Hi All :-) Thanks for all of your help Cor :-) I can not get the code you sent me to work in my application. I'm using an aspx datagrid in a web form. I'm getting the following error message...
2
by: Nina | last post by:
Hi there, I've tried everything that I know to prevent usre resizing datagrid columns, but nothing works. Following are the code that I used. Please tell me what's wrong with them. Thank you....
2
by: Bill nguyen | last post by:
I've been using Datagrid for most of my app's data entry screens. Now I have the need for users to select multiple rows for printing. Is it possible with Datagrid items? Thanks Bill
6
by: Frank | last post by:
Can someone please tell me when the ViewState is loaded? My understanding, based on http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconControlExecutionLifecycle.asp...
2
by: settyv | last post by:
Hi, I have webform which has 4 Datagrid controls with (built-in Pagination) and 4 search buttons to perform the search operation.When i click on search operation it is displaying the results in...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.