468,791 Members | 1,796 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,791 developers. It's quick & easy.

Help with DataGrid...

Hello!
There is a DataGrid on a form that is populated through DataTable and
filters have been applied to through DataView. The DataTable gets
updated through some events and obviously it also reflects at the
datagrid. Now problem arises, that whenever a new record is being
inserted in the datagrid, It scrolls waywardly, that distracts the
user's view. Is there any solution that this should not happen.
Points to note:
- DataGrid is not editable.
- I am also doing blinking for some records (to show error, or a new
record).
Waiting for an early responce.

Maqsood Ahmed
Kolachi Advanced Technologies

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
1 1202
Hi Maqsood,

This usually happens because of the sort set in the datagrid. For example, a
new record will probably be initially displayed at the bottom of the
datagrid. But when the user enters data in the column which is sorted, as
soon as the focus lost, the datagrid jumbles so as to maintain the sort.

You could avoid this problem
1. while inserting, set the datagrid to a 'default' sort. But this is not a
good method, because the datagrid will 'shiver' just before insertion
2. make sure that insertions happen @ some specific point only - like always
on top/bottom, or just below the current row. You could do this by
implementing your own 'background' sorting. Add a new column for the
datatable (which you will not show in the datagrid) in which you will store
the sort order. When the user sorts the datagrid, you will change the values
in this column so as to replicate the datagrid's row order. When the user
inserts data, you could set the new row's value as the max value or min value
(so as to put it in the bottom or top respectively).

And Maqsood, by blinking, do you mean you are using the error control?

HTH,
Rakesh Rajan

"Maqsood Ahmed" wrote:
Hello!
There is a DataGrid on a form that is populated through DataTable and
filters have been applied to through DataView. The DataTable gets
updated through some events and obviously it also reflects at the
datagrid. Now problem arises, that whenever a new record is being
inserted in the datagrid, It scrolls waywardly, that distracts the
user's view. Is there any solution that this should not happen.
Points to note:
- DataGrid is not editable.
- I am also doing blinking for some records (to show error, or a new
record).
Waiting for an early responce.

Maqsood Ahmed
Kolachi Advanced Technologies

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Michael Gorbach | last post: by
14 posts views Thread by Brett Sinclair | last post: by
2 posts views Thread by Brad Shook | last post: by
3 posts views Thread by Datatable Dataset Datagrid help | last post: by
4 posts views Thread by Jeff User | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.