Refresh datagrid without setting datasource to nothing and initialize again

  • Thread starter Thread starter AA
  • Start date Start date
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
 
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,dataset)).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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top