This topic shows how to update a view's definition at run time. It assumes you have created a project with two DataGrids bound to a C1DataViewSet and two text boxes. To update the view's definition at run time, add code to the Button_Click events:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click C1DataViewSet1.Views(0).Definition = TextBox1.Text End Sub |
To write code in C#
C# |
Copy Code
|
---|---|
private void button1_Click(object sender, EventArgs e) { C1DataViewSet1.Views[0].Definition = textBox1.Text; } |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Private Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) ) Handles Button2.Click C1DataViewSet1.Views("OrdDetProductView").Definition = TextBox2.Text End Sub |
To write code in C#
C# |
Copy Code
|
---|---|
private void button2_Click(object sender, EventArgs e) { C1DataViewSet1.Views["OrdDetProductView"].Definition = textBox2.Text; } |
The Update button enables the user to make and update changes to the view's definition statement in run time.
Observe that the views are filled automatically.