How to use Gridview controls to design forms in the development of .net language Smobiler
This article mainly introduces how to use Gridview controls to design forms in the development of .net language Smobiler. It is very detailed and has certain reference value. Friends who are interested must finish reading it.
The first word: Smobiler is a development platform that uses the .net language to develop APP in the VS environment, which may be more convenient than Xamarin.
I. Target style
To achieve the effect in the figure above, we need to do the following:
1. Drag a GridView control from "Smobiler Components" on the toolbar to the form interface
two。 Modify the properties of a GridView control
A.load event code
VB:
Private Sub TestGridView3_Load (senderAs Object, e As EventArgs) Handles MyBase.Load Dim matTable As New DataTable With matTable .Columns.add ("MAT_IMG", GetType (String)) .Columns.Add ("MAT_DESC1", GetType (String)) .Columns.Add ("MAT_DESC2", GetType (String)) .Columns.Add ("MAT_DESC3") GetType (String)) .Rows.Add () .Rows (0) ("MAT_IMG") = "img97" .Rows (0) ("MAT_DESC1") = "¥69.00" .Rows (0) ("MAT_DESC2") = "2015-07-08" .Rows (0) ("MAT_DESC3") = "1 invoice" .Rows.add () .Rows (1) ("MAT_IMG") = "img96" ".Rows (1) (" MAT_DESC1 ") =" ¥39.00 ".Rows (1) (" MAT_DESC2 ") =" 2015-07-08 ".Rows (1) (" MAT_DESC3 ") =" 1 invoice ".Rows.Add () .Rows (2) (" MAT_IMG ") =" img95 ".Rows (2) (" MAT_DESC1 ") =" ¥280.00 ".Rows (2) "MAT_DESC2") = "2015-07-08" .Rows (2) ("MAT_DESC3") = "1 invoice" End With Me.GridView1.DataSource = matTable Me.GridView1.DataBind () End Sub accounts: private void TestGridView3_Load (object sender) EventArgs e) {DataTable matTable = new DataTable () MatTable.Columns.Add ("MAT_IMG", typeof (string)); matTable.Columns.Add ("MAT_DESC1", typeof (string)); matTable.Columns.Add ("MAT_DESC2", typeof (string)); matTable.Columns.Add ("MAT_DESC3", typeof (string)); matTable.Rows.Add (); matTable.Rows [0] ["MAT_IMG"] = "img97" MatTable.Rows [0] ["MAT_DESC1"] = "¥69.00"; matTable.Rows [0] ["MAT_DESC2"] = "2015-07-08"; matTable.Rows [0] ["MAT_DESC3"] = "1 invoice"; matTable.Rows.Add (); matTable.Rows [1] ["MAT_IMG"] = "img96"; matTable.Rows [1] ["MAT_DESC1"] = "¥39.00" MatTable.Rows [1] ["MAT_DESC2"] = "2015-07-08"; matTable.Rows [1] ["MAT_DESC3"] = "1 invoice"; matTable.Rows.Add (); matTable.Rows [2] ["MAT_IMG"] = "img95"; matTable.Rows [2] ["MAT_DESC1"] = "¥280.00"; matTable.Rows [2] ["MAT_DESC2"] = "2015-07-08" MatTable.Rows [2] ["MAT_DESC3"] = "1 invoice"; this.GridView1.DataSource = matTable; this.GridView1.DataBind ();}
B.Layout attribute
Create a new MobileForm item, name it MessageShow3, and drag a Label control, as shown in figure 1
Bind the newly created form MessageShow3 to the Layout property of GridView, as shown in figure 2
Display effect of 3.Smobiler form design interface
Second, the display of mobile phone effect
These are all the contents of the article "how to use Gridview controls to design forms in the development of .net language Smobiler". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!