My code as follows
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- BindData();
- }
- }
- protected void BindData()
- {
- String strConnString = ConfigurationManager.ConnectionStrings["ConnectionStrings"].ConnectionString;
- SqlConnection con = new SqlConnection(strConnString);
- SqlCommand cmd = new SqlCommand("select * from [transact].[transaction_item] where status = 'new'", con);
- con.Open();
- SqlDataAdapter da = new SqlDataAdapter();
- DataSet ds = new DataSet();
- da.SelectCommand = cmd;
- da.Fill(ds);
- grdRpt.DataSource = ds;
- grdRpt.DataBind();
- }
- protected void grdRpt_PageIndexChanging(object sender, GridViewPageEventArgs e)
- {
- grdRpt.PageIndex = e.NewPageIndex;
- BindData();
- }
when i run the above code output as follows
selectdata transactid transactitemtype transactorgin status
Checkbox 1 123 IVC New
Checkbox 2 245 IVC New
Checkbox 3 345 IVC New
Checkbox 4 645 IVC New
Checkbox 5 723 IVC New
Checkbox 6 445 IVC New
Checkbox 7 545 IVC New
Checkbox 8 923 IVC New
Checkbox 9 245 IVC New
Checkbox 10 845 IVC New
1 2
1 and 2 paging will be there in the gridview
in first page five records will displayed and in the second page another five records will displayed.
suppose in the first page i check two rows and in the second page i check two rows means that selected check box rows to update in the [transact].[transaction_item] in the table.
for that how to do using c#.