Click here to Skip to main content
15,906,463 members
Home / Discussions / C#
   

C#

 
QuestionHow to get device state(enable or disable)? Pin
lovnin21-Jan-09 18:45
lovnin21-Jan-09 18:45 
AnswerRe: How to get device state(enable or disable)? Pin
Ben Fair22-Jan-09 4:51
Ben Fair22-Jan-09 4:51 
AnswerRe: How to get device state(enable or disable)? Pin
CooperWu22-Jan-09 14:48
CooperWu22-Jan-09 14:48 
Questiongetting the row index in c# Pin
amitpathak02421-Jan-09 18:11
amitpathak02421-Jan-09 18:11 
AnswerRe: getting the row index in c# Pin
RajpootRohan21-Jan-09 18:34
professionalRajpootRohan21-Jan-09 18:34 
Questiongetting the row index in c# Pin
RajpootRohan21-Jan-09 17:55
professionalRajpootRohan21-Jan-09 17:55 
AnswerRe: getting the row index in c# Pin
ColinM12321-Jan-09 18:11
ColinM12321-Jan-09 18:11 
GeneralRe: getting the row index in c# Pin
RajpootRohan21-Jan-09 18:16
professionalRajpootRohan21-Jan-09 18:16 
You mean to say the "currentrowindex" property.But it's not working.
Give me some idea.

I am using this code to update the row according to the user's input.

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;
        }

    }
    //dt.Rows.RemoveAt(index);
    DataGrid2.DataSource = dt;
    DataGrid2.DataBind();
}


cheers,
sneha

AnswerRe: getting the row index in c# Pin
dan!sh 21-Jan-09 19:22
professional dan!sh 21-Jan-09 19:22 
GeneralRe: getting the row index in c# Pin
RajpootRohan21-Jan-09 19:42
professionalRajpootRohan21-Jan-09 19:42 
AnswerRe: getting the row index in c# Pin
lachu00921-Jan-09 22:48
lachu00921-Jan-09 22:48 
Question[Message Deleted] Pin
Nikki0521-Jan-09 17:45
Nikki0521-Jan-09 17:45 
AnswerRe: How to write the web method. Pin
Ashfield21-Jan-09 21:05
Ashfield21-Jan-09 21:05 
QuestionHow to implement kerberos authentication in C# Pin
lachu00921-Jan-09 17:04
lachu00921-Jan-09 17:04 
AnswerRepost Pin
dan!sh 21-Jan-09 19:15
professional dan!sh 21-Jan-09 19:15 
QuestionCreate Stored Proc at Window Start up Pin
CodingYoshi21-Jan-09 16:35
CodingYoshi21-Jan-09 16:35 
AnswerRe: Create Stored Proc at Window Start up Pin
ColinM12321-Jan-09 16:49
ColinM12321-Jan-09 16:49 
AnswerRe: Create Stored Proc at Window Start up Pin
PIEBALDconsult21-Jan-09 17:37
mvePIEBALDconsult21-Jan-09 17:37 
GeneralRe: Create Stored Proc at Window Start up Pin
Ashfield21-Jan-09 21:07
Ashfield21-Jan-09 21:07 
GeneralRe: Create Stored Proc at Window Start up Pin
CodingYoshi22-Jan-09 3:37
CodingYoshi22-Jan-09 3:37 
QuestionWM_CAP_CONNECT opens Dialog when device is in use Pin
Ze_rman21-Jan-09 15:21
Ze_rman21-Jan-09 15:21 
AnswerRe: WM_CAP_CONNECT opens Dialog when device is in use Pin
_Maxxx_21-Jan-09 16:07
professional_Maxxx_21-Jan-09 16:07 
GeneralRe: WM_CAP_CONNECT opens Dialog when device is in use Pin
Ze_rman22-Jan-09 3:58
Ze_rman22-Jan-09 3:58 
QuestionGetting Selected Index + Datakeys Pin
CrimeanTurtle200821-Jan-09 14:08
CrimeanTurtle200821-Jan-09 14:08 
QuestionPinging a port Pin
Silvyster21-Jan-09 14:03
Silvyster21-Jan-09 14:03 

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.