Click here to Skip to main content
15,891,253 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Design Problem for Multiple controls in an update Panel ? Pin
Rutvik Dave22-Jan-09 3:59
professionalRutvik Dave22-Jan-09 3:59 
QuestionLog Out Pin
jonhbt21-Jan-09 22:40
jonhbt21-Jan-09 22:40 
AnswerRe: Log Out Pin
VenkatFor.NET22-Jan-09 20:29
VenkatFor.NET22-Jan-09 20:29 
QuestionStateless UserControl ! Pin
mehrdadc4821-Jan-09 20:53
mehrdadc4821-Jan-09 20:53 
Questionhow to recieve mails to my .net application Pin
prasanth.moganti21-Jan-09 20:44
prasanth.moganti21-Jan-09 20:44 
AnswerRe: how to recieve mails to my .net application Pin
Abhijit Jana21-Jan-09 21:03
professionalAbhijit Jana21-Jan-09 21:03 
AnswerRe: how to recieve mails to my .net application Pin
Abhishek Sur21-Jan-09 21:06
professionalAbhishek Sur21-Jan-09 21:06 
Questiondelete a row? Pin
RajpootRohan21-Jan-09 20:25
professionalRajpootRohan21-Jan-09 20:25 
Hi,

I am having datagrid in which data is coming.Suppose we have three rows in the datagrid.Each row is having a checkbox.In each row we have five columns. One of them is "QTY" which is having a textbox as a templte column.Below the grid we have a "update" button.Suppose in the original state quantity is "1".And the user changes it to "4" and presses the update button.Then the row should be modified having quantity "4".

What I have done is:
protected void BtnUpdate_Click(object sender, EventArgs e)
{
    dt = (DataTable)Session["Cart"];
    CheckBox chkSelected = new CheckBox();

    foreach (DataGridItem dgItem in DataGrid2.Items)
    {
        chkSelected = (CheckBox)dgItem.FindControl("chkSelection");

        if (chkSelected.Checked == true)
        {


            TextBox TxtQTY = (TextBox)dgItem.Cells[2].FindControl("TxtQTY");
            int Txt2 = Convert.ToInt32(TxtQTY.Text);

            Label lblProduct_Id = (Label)dgItem.Cells[0].FindControl("lblProduct_Id");
            string id2 = lblProduct_Id.Text;

            Label lblDescription = (Label)dgItem.Cells[1].FindControl("lblDescription");
            string desc2 = lblDescription.Text;

            Label lblPrice = (Label)dgItem.Cells[3].FindControl("lblPrice");
            float price2 = Convert.ToSingle(lblPrice.Text);

            Label lblCost = (Label)dgItem.Cells[3].FindControl("lblCost");
            float cost2 = Convert.ToSingle(lblCost.Text);

            float final_cost = price2 * Txt2;

              DataRow myrow = dt.NewRow();
              myrow["REF"] = id2;
              myrow["Description"] = desc2;
              myrow["QTY"] = Txt2;
              myrow["Price"] = price2;
              myrow["Cost"] = final_cost;

              dt.Rows.Add(myrow);
              dt.AcceptChanges();
              Session["data"] = dt;
        }

    }
    DataGrid2.DataSource = dt;
    DataGrid2.DataBind();
}


But when I am pressing the update button it is updating the row but it is also showing the previous row.
I am trying to get the index of the row which is checked by the user to update.And then I will delete that row.
But I am unable to do this.

Help me out ...

Thanx in advance.

cheers,
sneha

AnswerRe: delete a row? Pin
Muhammad Gouda21-Jan-09 20:46
Muhammad Gouda21-Jan-09 20:46 
GeneralRe: delete a row? Pin
N a v a n e e t h21-Jan-09 21:31
N a v a n e e t h21-Jan-09 21:31 
AnswerRe: delete a row? Pin
Neeraj Kr21-Jan-09 20:49
Neeraj Kr21-Jan-09 20:49 
QuestionWrapper Pin
mehrdadc4821-Jan-09 19:55
mehrdadc4821-Jan-09 19:55 
AnswerRe: Wrapper Pin
Abhishek Sur21-Jan-09 21:07
professionalAbhishek Sur21-Jan-09 21:07 
QuestionCannot download files because of a conflict between WebParts and UpdatePanels Pin
Muhammad Gouda21-Jan-09 19:54
Muhammad Gouda21-Jan-09 19:54 
AnswerHopeless Case ?!!!!!! Pin
Muhammad Gouda21-Jan-09 21:25
Muhammad Gouda21-Jan-09 21:25 
QuestionNeed code for sending invitation to link in ASP.Net [modified] Pin
Jas 00721-Jan-09 19:43
Jas 00721-Jan-09 19:43 
AnswerRe: Need code for sending invitation to link in ASP.Net Pin
Abhishek Sur21-Jan-09 21:08
professionalAbhishek Sur21-Jan-09 21:08 
GeneralRe: Need code for sending invitation to link in ASP.Net Pin
Abhijit Jana21-Jan-09 21:12
professionalAbhijit Jana21-Jan-09 21:12 
Questionconverting exel data into SQL data. Pin
Nilesh S.Badge21-Jan-09 19:42
Nilesh S.Badge21-Jan-09 19:42 
AnswerRe: converting exel data into SQL data. Pin
Jas 00721-Jan-09 19:48
Jas 00721-Jan-09 19:48 
AnswerRe: converting exel data into SQL data. Pin
Abhishek Sur21-Jan-09 21:15
professionalAbhishek Sur21-Jan-09 21:15 
AnswerRe: converting exel data into SQL data. Pin
Rutvik Dave22-Jan-09 4:06
professionalRutvik Dave22-Jan-09 4:06 
QuestionFile upload to FTP Pin
Radhakrishnan G.21-Jan-09 18:45
Radhakrishnan G.21-Jan-09 18:45 
AnswerRe: File upload to FTP Pin
Abhishek Sur21-Jan-09 19:30
professionalAbhishek Sur21-Jan-09 19:30 
GeneralRe: File upload to FTP Pin
Radhakrishnan G.21-Jan-09 19:58
Radhakrishnan G.21-Jan-09 19:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.