Visual Basic (Declaration) | |
---|---|
Public Sub RebindDataSource() |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As WebGrid instance.RebindDataSource() |
C# | |
---|---|
public void RebindDataSource() |
Delphi | |
---|---|
public procedure RebindDataSource(); |
JScript | |
---|---|
public function RebindDataSource(); |
Managed Extensions for C++ | |
---|---|
public: void RebindDataSource(); |
C++/CLI | |
---|---|
public: void RebindDataSource(); |
C# | Copy Code |
---|---|
private void Button1_Click(object sender, System.EventArgs e) { WebGrid1.ClearCachedDataSource(); WebGrid1.RebindDataSource(); } |
In this method, WebGrid will automatically reinvoke InitializeDataSource event, so the concept of centralized DataSource initialization still persist. However, before this event is invoked, ClearCachedDataSource must invoked first, otherwise RebindDataSource will only invoke PrepareDataBinding event because there is a cache maintained inside the WebGrid. Please look at the sample code above.
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family