Friday, September 28, 2012

test


DropDownList1.DataSource = ds;
DropDownList1.DataValueField = "id";
DropDownList1.DataTextField = "username";
DropDownList1.Items.Clear();
DropDownList1.Items.Insert(0, new ListItem("Select", "Select"));
DropDownList1.DataBind();


GridView1.DataKeys[e.RowIndex][0].ToString();


 protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {
        GridView1.EditIndex = e.NewEditIndex;
        BindGrid();
    }


protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
    {
        GridView1.EditIndex = -1;
        BindGrid();
    }


if (con != null)
            {
                con.Close();
            }
            if (cmd != null)
            {
                cmd.Dispose();
            }




No comments:

Post a Comment