The web| control usage is simpler, without having to write a line of code (this is one of the primary purposes of my control writing).
There are three steps:
The first step: referencing the script library and CSS style sheet library in the page, which could have been closed to the resource file, this step is too lazy to do:
The code is as follows:
<link href= "Myfsheet.css" type= "Text/css" rel= "stylesheet" >
<script language= "javascript" src= "Updarray_lrc.js" type= "Text/javascript" ></script>
Step Two: Add the Lrcgrid control to the toolbar, and drag the Lrcgrid control onto the page (which everyone understands).
Step three: Set the properties of the Lrcgrid control
Property name Type feature notes
Selsql property String Type SQL SELECT statement SELECT [Column name] as [display name],....... From [table name] where [condition], you can also not write where condition. Keywords: SELECT, as, from, WHERE must be uppercase
For example: SELECT YF as meter reading month, customer_id as user name, am_id as energy meter code, YCBDS as the table of the month, Ymbds as the base from COMP_DY_SGCB WHERE am_id = ' 0 001 '
Prikey property String Type primary Key name (if multiple primary keys are comma "," separated)
The Eidtcol property string type can be modified by a comma "," separated from the column name, set to "1" to indicate that all columns except the primary key column are edited
Titcolor Property Color Type header row background color
Colsstr Property String The dataset you display requires a comma between column names in the format of the column names in the database
Collstrcn Property String Type the display column name of the dataset that you display (that is, the name after as) requires the same, and the display names are separated by commas
The Conn Property database connection string can be empty and, if left blank, the control automatically reads the value from the Web.config's conn key: System.configuration.configurationsettings.appsettings[" Conn "]
Fkcol property FOREIGN KEY format: Column Name 1 (not display name) | Foreign key column name 1| foreign key Display column name 1| foreign key table name 1, column Name 2 (not display name) | Foreign key column name 2| foreign key Display column name 2| foreign key table name 2,......。 For example: Jlxz_code|jlxz_code|name|code_comp_jlxz,gds_code|gds_code|name|code_sys_gds Note: The foreign key columns you listed must be included in the columns listed in the Editcol attribute, That is, only the foreign key columns work when the columns are edited
The Isadd property bool control has the ability to add records.
Isdel Property type bool has the ability to delete records.
Isrowedit Property type bool control has column change record functionality
Issort property bool Control has the ability to sort
Istabchg property bool Control has the ability to jump focus with carriage return
Table name of the database for the Tabn property string type control operation
Ispager whether a bool type control has paging functionality
CurrentPageIndex gets and sets the page index based on 0
ItemsPerPage int gets and sets the number of records to display per page. The default value shows 10 items per page
PagerStyle enumeration This value indicates the style of the pager user interface it can be a PagerStyle enumeration value: Nextprev and NumericPages. In Nextprev mode, VCR-style buttons are displayed to go to the first, previous, Next, and last pages. In numericpages mode, a drop-down list is displayed, listing the indexes of all available pages
Supplemental NOTE: If you have more than one table in your SQL selection statement, you must set the COLSSTR and TABN values.
Then one of your datasheet operations page is complete.