Xsoft custom server control XGridView 1.0

(Solution of real time .NET Problems)

User Controls is a small part of a page that will be reused in your web pages.
Easy to add to your web pages. You can modify this control to you own wishes.

Overview

The GridView control is used to display data in a table. When using the GridView control, you can display, edit, delete, sort, and page through tabular data from many different kinds of data sources, including databases, XML files, and business objects that expose data.

Using the GridView you can

  • Automatically bind to and display data from a data source control
  • Select, sort, page through, edit, and delete data from a data source control
  • Additionally, you can customize the appearance and behavior of the GridView control
  • The XGridView control provides a simple additional panel.
  • Using ShowAdditionalPanel property you can paging and searching in gridview

  • How to use XGridView Example

    Register the Assembly in an ASP.NET Application Web Form
    In a .NET programming environment, open the Form .aspx source window, and then add the following tag to the top of the code

    You can now use the control from any ASP.NET page in your application's root directory (or any of its subfolders).

    Code behind


            
            using System;
            using System.Collections.Generic;
            using System.Linq;
            using System.Web;
            using System.Web.UI;
            using System.Web.UI.WebControls;
            using System.Data;
    
            namespace TestControl
            {
                public partial class ExampleGridView : System.Web.UI.Page
                {
                    private IList Getcontacts()
                    {
                        var path = HttpContext.Current.Server.MapPath(@"contacts.xml");
                        var data = new DataSet();
                        data.ReadXml(path);
                        var contacts = new List();
                        foreach (DataRow row in data.Tables[0].Rows)
                        {
                            contacts.Add(new Contact
                            {
                                ID = Convert.ToInt32(row["ID"]),
                                Name = Convert.ToString(row["Name"]),
                                Age = Convert.ToInt32(row["Age"]),
                                Sex = Convert.ToString(row["Sex"]),
                                Email = Convert.ToString(row["Email"]),
                                Phone = Convert.ToString(row["Phone"]),                    
                            });
                        }
                        return contacts;
    
                    }
    
                    protected override void OnPreRender(EventArgs e)
                    {
                        var contacts = Getcontacts();
                        XGridView1.DataSource = contacts;
    
                        foreach (var item in contacts)
                        {
                            if (item.ID == XGridView1.SelectedDocumentID)
                            {
                                txtbox.Text = item.Name;
                                break;
                            }
                        }
    
                    }
    
                    public class Contact
                    {
                        public int ID { get; set; }
                        public string Name { get; set; }
                        public int Age { get; set; }
                        public string Sex { get; set; }
                        public string Email { get; set; }
                        public string Phone { get; set; }            
                    }
                }
            }
            
            
      For information about building the control and using it in a page, see
    • Demo

    Services

      knowledge of technology technology management

    Software project management
    Client-server technologies
    Internet technologies and networking Web application development
    Windows network administration and maintenance
    Operating systems – Windows, DOS Mobile Technologies