![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, When some control in a page modifies the data displayed in a datagrid (through an sql update query, of course), how do I refresh the datagrid? Binding the datagrid doesn't seem to work. Re-binding the datasource doesn't work. Binding the datasources also doesn't help. Kind regards, Pieter |
#3
| |||
| |||
|
|
Yes, you need to re-bind. If it doesn't work, there is a problem in the way how you are doing it. |
#4
| |||
| |||
|
|
Eliyahu Goldin schreef: Yes, you need to re-bind. If it doesn't work, there is a problem in the way how you are doing it. How do I go around debugging this? Does the datagrid emit trace/warnings somewhere? Do you have an example on how this should be done officially? Kind regards, Pieter |
#5
| |||
| |||
|
|
What do you use for databinding: DataSource or DataSourceID? |
#6
| |||
| |||
|
|
Eliyahu Goldin schreef: What do you use for databinding: DataSource or DataSourceID? DataSourceID It works when I insert a new row It doesn't work when I update an existing row. The code I use to refresh: myGrid.DataSourceID = null; myGrid.DataSourceID = "mydatasource"; myGrid.DataBind(); Kind regards, Pieter |
#7
| |||
| |||
|
|
Run the select statement of your datasource: mydatasource.Select(System.Web.UI.DataSourceSelect Arguments.Empty); No need to rebind the grid, it should pick up the changes automatically. |
#8
| |||
| |||
|
|
Run the select statement of your datasource: mydatasource.Select(System.Web.UI.DataSourceSelect Arguments.Empty); No need to rebind the grid, it should pick up the changes automatically. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |