This is a migrated thread and some comments may be shown as answers.

multi check box checking

1 Answer 91 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mohamed
Top achievements
Rank 1
mohamed asked on 10 May 2011, 08:29 AM
in  command one or more check box are checked
i check going to insert the record
i fill the record first time. that record only stay for last time it's self .
how i solve this
which record selected that record going to saved but one condition
that already check in and  save .


select a.Contract_Description from Asset_Service_Contracts a, Asset_Service_Contracts b " +
                                             " where a.Contract_AssetID is null and a.Contract_Description = '" + name + "' and " +
                                             " a.Contract_Description=b.Contract_Description



else if (e.CommandName == "RowClick")
            {
                DataTable dt1 = new DataTable();
                DataTable dt2 = new DataTable();

                GridDataItem item = (GridDataItem)e.Item;
                ContractID = item["ContractID"].Text;


                foreach (GridDataItem item1 in RadGrid_ServiceContracts.SelectedItems) // Loop through each selected items
                {
                    Response.Write(item1["ContractID"].Text.ToString());  // Where ID is the ColumnUniqueName                     
                    Response.Write(item1["Contract_Description"].Text.ToString());  // Where ID is the ColumnUniqueName       
                    string ID = item1["ContractID"].Text;
                    string name = item1["Contract_Description"].Text;                    
                    try
                    {
                        string selectQuery = " select a.Contract_Description from Asset_Service_Contracts a, Asset_Service_Contracts b " +
                                             " where a.Contract_AssetID is null and a.Contract_Description = '" + name + "' and " +
                                             " a.Contract_Description=b.Contract_Description ";
                        sqladp.SelectCommand = new SqlCommand(selectQuery, sqlconn);
                        sqladp.Fill(dt1);
                        int i = dt1.Rows.Count;
                        dt1 = null;
                        if (i == 0)
                        {

                        }
                    }
                    catch (Exception ex)
                    {
                        RadGrid_ServiceContracts.Controls.Add(new LiteralControl("Unable to delete Id. Reason: " + ex.Message));
                        e.Canceled = true;
                    }
                }
            }


thanks,
mohamed

1 Answer, 1 is accepted

Sort by
0
mohamed
Top achievements
Rank 1
answered on 10 May 2011, 10:54 AM
problem resolved
Tags
Grid
Asked by
mohamed
Top achievements
Rank 1
Answers by
mohamed
Top achievements
Rank 1
Share this question
or