saumathur
asked on
DataGrid and CheckBoxes works but cant get each cell info
I am working on the rainbow portal and am able to include checkboxes in my datagrid. I want to dynamically have the checkboxes to put either a tick or stay unchecked depending on my database table.
I have already created a stored procedure and all to get the value from the datatable. But the problem is that i want to feed in some parameters in to the stored procedure at the Page_Load section of the page, and over there, it does not know what the DataGridEventsCommand arguments are..:
Here is what I mean :
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
CDesignStoreDB oDS = new CDesignStoreDB();
DataGrid1.DataSource = oDS.GetInformation(ModuleI D);
DataGrid1.DataBind();
DataGrid2.DataSource = oDS.GetLoanDetails(ModuleI D);
DataGrid2.DataBind();
CheckBox hasTaken;
CheckBox hasReturned;
//TableCell itemSN = e.Item.Cells[2]; //IT DOES NOT KNOW WHAT THIS IS
//TableCell itemPD = e.Item.Cells[3];//THIS WORKS ELSEWHERE IN EVENTS // FUNCTIONS
/* string PackDescr = itemPD.Text;
string StudNo = itemSN.Text;
foreach(DataGridItem dgi in this.DataGrid2.Items)
{
hasTaken = (CheckBox) dgi.Cells[0].Controls[1];
string hT = oDS.GetHasTaken(10239, PackDescr, StudNo);
if(hT == "YES")
{
hasTaken.Checked = Convert.ToBoolean(1);
}
}
*/
if(!IsPostBack)
{
DataGrid1.DataSource = oDS.GetInformation(ModuleI D);
DataGrid1.DataBind();
DataGrid2.DataSource = oDS.GetLoanDetails(ModuleI D);
DataGrid2.DataBind();
}
}
TableCell itemSN = e.Item.Cells[2]; does not know what 'e' in the context of the datagrid is. So, how can i get the values from the datagrid to assign the strings to them and feed them to the stored procedure function..!!???
Thanks
I have already created a stored procedure and all to get the value from the datatable. But the problem is that i want to feed in some parameters in to the stored procedure at the Page_Load section of the page, and over there, it does not know what the DataGridEventsCommand arguments are..:
Here is what I mean :
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
CDesignStoreDB oDS = new CDesignStoreDB();
DataGrid1.DataSource = oDS.GetInformation(ModuleI
DataGrid1.DataBind();
DataGrid2.DataSource = oDS.GetLoanDetails(ModuleI
DataGrid2.DataBind();
CheckBox hasTaken;
CheckBox hasReturned;
//TableCell itemSN = e.Item.Cells[2]; //IT DOES NOT KNOW WHAT THIS IS
//TableCell itemPD = e.Item.Cells[3];//THIS WORKS ELSEWHERE IN EVENTS // FUNCTIONS
/* string PackDescr = itemPD.Text;
string StudNo = itemSN.Text;
foreach(DataGridItem dgi in this.DataGrid2.Items)
{
hasTaken = (CheckBox) dgi.Cells[0].Controls[1];
string hT = oDS.GetHasTaken(10239, PackDescr, StudNo);
if(hT == "YES")
{
hasTaken.Checked = Convert.ToBoolean(1);
}
}
*/
if(!IsPostBack)
{
DataGrid1.DataSource = oDS.GetInformation(ModuleI
DataGrid1.DataBind();
DataGrid2.DataSource = oDS.GetLoanDetails(ModuleI
DataGrid2.DataBind();
}
}
TableCell itemSN = e.Item.Cells[2]; does not know what 'e' in the context of the datagrid is. So, how can i get the values from the datagrid to assign the strings to them and feed them to the stored procedure function..!!???
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
what is the specific row in the datagrid from which you want to take the values and feed to the sp ??
ASKER