Essentailly the user would be presented a grid via an aspx page that contains some information. The user can select rows from the grid that they want to process. Once the user makes their selection and clicks Button1 the Button1_Click() method is invoked and processes only the selected records. Each row will be processed and the code will call a stored procedure to insert records into a MS SQL table.
Keep in mind this assumes you have already created a radgrid called "RadGrid1" and binded all of the data correctly. It also assumes you have placed the grid to a placeholder called "PlaceHolder1". Here is an example of the Button1_Click() method:
- Code: Select all
protected void Button1_Click(object sender, System.EventArgs e )
{
RadGrid radGrid1 = null;
for (int i = 0; i < this.PlaceHolder1.Controls.Count; i++)
{
if (this.PlaceHolder1.Controls[i].GetType() == typeof(RadGrid))
{
radGrid1 = (RadGrid)this.PlaceHolder1.Controls[i];
break;
}
}
if (radGrid1 != null)
{
GridDataItem row = null;
string pkey;
for (int i = 0; i < radGrid1.SelectedItems.Count; i++)
{
row = (GridDataItem)radGrid1.SelectedItems[i];
pkey = radGrid1.SelectedItems[i].Cells[0].Text;
//Call method that inserts records into MS SQL here//
}
}
}
