Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DataGrid and CheckBoxes works but cant get each cell info

Posted on 2004-09-12
3
Medium Priority
?
256 Views
Last Modified: 2010-04-15
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(ModuleID);
                  DataGrid1.DataBind();

                  DataGrid2.DataSource = oDS.GetLoanDetails(ModuleID);
                  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(ModuleID);
                        DataGrid1.DataBind();

                        DataGrid2.DataSource = oDS.GetLoanDetails(ModuleID);
                        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
0
Comment
Question by:saumathur
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 23

Accepted Solution

by:
rama_krishna580 earned 1500 total points
ID: 12037915
0
 

Author Comment

by:saumathur
ID: 12038708
i dont have a webform here, its a web user control, and the datagrid is on that, and even had a look at those pages, still cant work out how to select one particular cell in the datagrid to correspond to the checkbox associated with that row.
0
 

Expert Comment

by:shilpa2784
ID: 12041746
what is the specific row in the datagrid from which you want to take the values and feed to the sp ??
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question