By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,825 Members | 1,708 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,825 IT Pros & Developers. It's quick & easy.

Refresh datagrid without setting datasource to nothing and initialize again

P: n/a
AA
Do anyone know how to refresh the datagrid without setting datasource to
nothing and initialize the grid again?

My case is that I have form consisting from two part. The upper part is a
datagrid while the lower is the record detail.
Once user, said selected/hightlighted row 3 for editing the detail info.
Then, user click "Save". I want the datagrid to be refreshed so as to
displaying the latest changes of the record info without moving out the
focus from row 3.

Thx in advance!

Richard
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
AA

O assume that we are talking about a windowforms.

A datagrid holds no data, it displays the data via the datasource (which
mostly holds as well not data). So changing items to what the datasource
references again to should change the datagrid as well.
Do anyone know how to refresh the datagrid without setting datasource to
nothing and initialize the grid again?
What can be is that your data is still only in the textbox and than you have
to do something as

bindingcontext(directcast(datagrid1.datasource,dat aset)).endcurentedit

(where dataset is datatable or dataview when it are one of those)

(I tried this one never in this way however that should go in my opinion)

When not message back.

I hope this helps?

Cor
Cor

My case is that I have form consisting from two part. The upper part is a
datagrid while the lower is the record detail.
Once user, said selected/hightlighted row 3 for editing the detail info.
Then, user click "Save". I want the datagrid to be refreshed so as to
displaying the latest changes of the record info without moving out the
focus from row 3.

Thx in advance!

Richard

Nov 20 '05 #2

P: n/a
AA
Thx Cor....
Since I am using direct sql statement for updating the content,
may I need to refresh the datasource instead.

Let me try.....Thx a lot!

Richard
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:eM**************@TK2MSFTNGP11.phx.gbl...
AA

O assume that we are talking about a windowforms.

A datagrid holds no data, it displays the data via the datasource (which
mostly holds as well not data). So changing items to what the datasource
references again to should change the datagrid as well.
Do anyone know how to refresh the datagrid without setting datasource to
nothing and initialize the grid again?
What can be is that your data is still only in the textbox and than you

have to do something as

bindingcontext(directcast(datagrid1.datasource,dat aset)).endcurentedit

(where dataset is datatable or dataview when it are one of those)

(I tried this one never in this way however that should go in my opinion)

When not message back.

I hope this helps?

Cor
Cor

My case is that I have form consisting from two part. The upper part is a datagrid while the lower is the record detail.
Once user, said selected/hightlighted row 3 for editing the detail info.
Then, user click "Save". I want the datagrid to be refreshed so as to
displaying the latest changes of the record info without moving out the
focus from row 3.

Thx in advance!

Richard


Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.