Gridview property

Gridview property

Previous Home Next

 

the GridView is similar to the version 1.0 DataGrid .The aims of the GridView:-
To support the new data source controls by exposing a binding model that allows developers to display data without the need to write any code

To provide features such as sorting, paging, editing, and updating of the data without requiring any code to be written

To support the adaptive page rendering approach used in other controls in version 2.0, providing output that is compatible with mobile devices and other user agents

To add features requested by users of the version 1.0 DataGrid control, such as multiple-field primary keys, hyperlink columns that have more than one data field, columns with checkboxes, and columns with standard buttons

To provide better templating options to support custom paging and better support for null values

    
     

    

 ...........desigining code for Gridview.......................


            
        .............................................................
...........cs code.ForGridview property with button click.  ........
 .................................................................


 protected void Button1_Click(object sender, EventArgs e)
    {
       
        showfvi.Enabled = true;
        showfvi.Font.Italic=true;
       DataTable dt=new DataTable();
        dt.Columns.Add("id");
        dt.Columns.Add("name");
        DataRow dr = dt.NewRow();
        dr["id"]="101".ToString();
        dr["name"]="Aditya";
        dt.Rows.Add(dr);
        dr = dt.NewRow();
        dr["id"]="102".ToString();
        dr["name"]="sonal";
        dt.Rows.Add(dr);
        dr = dt.NewRow();
        dr["id"]="103".ToString();
        dr["name"]="kamal";
        dt.Rows.Add(dr);
        dr = dt.NewRow();
        dr["id"]="104".ToString();
        dr["name"]="Anoop";
        dt.Rows.Add(dr);
        dr = dt.NewRow();
        dr["id"]="105".ToString();
        dr["name"]="Anuj";
        dt.Rows.Add(dr);
        showfvi.DataSource=dt;
        showfvi.DataBind();

        
        }
Previous Home Next