Full edit WebGrid Control Lrcgrid (3)--Overall structure

Source: Internet
Author: User
Full edit WebGrid Control Lrcgrid (3)--Overall structure
Resource file:
Lrcgrid uses two reference files: A CSS style sheet file myfsheet.css, a JS script library file updarray_lrc.js.
The style sheet file holds the style sheet class that is applied to the text box, and is used when the text box is in different modes (browse, edit, Focus)
1. Hide (browse) style:
. Lrc_txt_hid
{
Border-style:none;
width:95;
Background:url (images/txt_back.gif);
}

2. Edit style:
. lrc_txt_show
{
Border-style:groove;
Background-color: #ffffff;
width:95;
}

3. Focus Style:
. lrc_txt_edit
{
Border-width:medium;
Border-style:groove;
Font-weight:bolder;
Background-color:yellow;
width:95;
}

Script Library: A function that contains a control client action. Including:
function to switch table rows to edit mode: Chgeditrow (Rowindex,tab) ()
function to switch table columns to edit mode: Chgedit (Colindex,tab)
To construct an SQL statement that updates a database on a client: BuildSQL (tabname)
Functions to add new records: addrow (tab)
To remove a newly added row function: Removerow (tab):
Will post all the code later, if it's too long to stick here.
Lrcgrid class Structure:
Lrcgrid contains three classes and an enumeration
Virtualrecordcount class: Record paging information
Pagechangedeventargs class: Inheriting from EventArgs page-changing events
PagerStyle enumeration: Form enumeration of pager bars
Lrcgrid class: Inherit from System.Web.UI.WebControls.Table, implement INamingContainer interface.
The first few are relatively simple, I put the code directly posted.
class that #region Virtualrecordcount class to record paging information
public class Virtualrecordcount
{
public int RecordCount;
public int PageCount;
public int recordsinlastpage;
}
#endregion

Enumeration #region PagerStyle Enum Pager Bar
public enum PagerStyle
{
Nextprev,
NumericPages
}
#endregion

#region Pagechangedeventargs Class Page-Change event classes
public class Pagechangedeventargs:eventargs
{
public int oldpageindex;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.