Click here to Skip to main content
15,887,812 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerAmazon has a SDK Pin
David Mujica12-May-14 10:08
David Mujica12-May-14 10:08 
QuestionGenerat PDF from aspx page. in asp.net with formating Pin
deepika wani11-May-14 20:39
deepika wani11-May-14 20:39 
QuestionGoogle Site - SMTP support? ASP.NET? Microsoft SQL server? Pin
Swab.Jat11-May-14 20:27
Swab.Jat11-May-14 20:27 
AnswerRe: Google Site - SMTP support? ASP.NET? Microsoft SQL server? Pin
Richard MacCutchan11-May-14 23:16
mveRichard MacCutchan11-May-14 23:16 
GeneralRe: Google Site - SMTP support? ASP.NET? Microsoft SQL server? Pin
Swab.Jat12-May-14 12:55
Swab.Jat12-May-14 12:55 
QuestionHow to display a radiobuttonList along with a textbox with dynamically generated values? Pin
samflex9-May-14 14:33
samflex9-May-14 14:33 
AnswerRe: How to display a radiobuttonList along with a textbox with dynamically generated values? Pin
Richard MacCutchan9-May-14 21:46
mveRichard MacCutchan9-May-14 21:46 
Questionset values to TextBox in Item template of gridview Pin
ganesh169-May-14 6:08
ganesh169-May-14 6:08 
<headerstyle backcolor="#4A3C8C" font-bold="True" forecolor="#E7E7FF">


<asp:panel id="PanelOutDCItemDetails" runat="server">
<asp:gridview id="gvOutDCItemDetails" runat="server" allowpaging="True"
="" pagesize="6" autogeneratecolumns="False" onrowdatabound="gvOutDCItemDetails_RowDataBound" onrowcommand="gvOutDCItemDetails_RowCommand" onselectedindexchanged="gvOutDCItemDetails_SelectedIndexChanged" backcolor="White" bordercolor="White" borderstyle="Ridge" borderwidth="2px" cellpadding="3" cellspacing="1" gridlines="None" datakeynames="Item_Id">
<columns>
<asp:commandfield showdeletebutton="True">
<asp:boundfield headertext="Item Id" datafield="Item_Id">
<asp:boundfield headertext="Item Name" datafield="IName">
<asp:boundfield headertext="Net Quantity" datafield="I_Quantity">
<asp:boundfield datafield="Remaining_Qty" headertext="Remaining Quantity">
<asp:templatefield headertext="Process">
<itemtemplate>
<asp:dropdownlist id="ddrProcess" runat="server">




<asp:templatefield headertext="Dispatch Quantity">
<itemtemplate>
<asp:textbox id="txtDispatchQuantity" runat="server" autopostback="true" ontextchanged="TextChanged_txtDispatchQuantity">

<asp:templatefield headertext="Remaining Quantity">
<itemtemplate>
<asp:textbox id="txtRamainingQuantity" runat="server">

<asp:templatefield headertext="Rate">
<itemtemplate>
<asp:textbox id="txtRate" runat="server" autopostback="true" ontextchanged="txtRate_TextChanged">

<asp:templatefield headertext="Amount">
<itemtemplate>
<asp:textbox id="txtAmount" runat="server">

<asp:templatefield>
<itemtemplate>
<asp:label id="lblStatus" runat="server" text="Status">



<footerstyle backcolor="#C6C3C6" forecolor="Black">
<headerstyle backcolor="#4A3C8C" font-bold="True" forecolor="#E7E7FF">
<pagerstyle backcolor="#C6C3C6" forecolor="Black" horizontalalign="Right">
<rowstyle backcolor="#DEDFDE" forecolor="Black">
<selectedrowstyle backcolor="#9471DE" font-bold="True" forecolor="White">
<sortedascendingcellstyle backcolor="#F1F1F1">
<sortedascendingheaderstyle backcolor="#594B9C">
<sorteddescendingcellstyle backcolor="#CAC9C9">
<sorteddescendingheaderstyle backcolor="#33276A">

<selectedrowstyle backcolor="#9471DE" font-bold="True" forecolor="White">


Here is my C# code

protected void gvOutDC_SelectedIndexChanged1(object sender, EventArgs e)
   {
       if (gvOutDC.SelectedIndex >= 0)
       {
           btnsave.Enabled = false;
           btnInword.Visible = false;

           OutDC.Visible = true;
           OutDCItemDetails.Visible = true;
           View.Visible = false;
           InwordDetails.Visible = false;
           txtOutId.Visible = true;
           txtoutCode.Enabled = false;
           btn.Visible = true;
           txtcustcode.Enabled = false;
           btnsave.Enabled = true;


           txtOutId.Text = gvOutDC.SelectedDataKey[0].ToString();

           txtoutCode.Text = gvOutDC.SelectedRow.Cells[2].Text.ToString();
           txtDate.Text =gvOutDC.SelectedRow.Cells[8].Text.ToString();
           txtCustomerId.Text = gvOutDC.SelectedRow.Cells[5].Text.ToString();
           txtcustcode.Text = gvOutDC.SelectedRow.Cells[7].Text.ToString();
           txtCustomerName.Text = gvOutDC.SelectedRow.Cells[6].Text.ToString();
           int inworditem = Convert.ToInt16(gvOutDC.SelectedRow.Cells[3].Text.ToString());
           SqlCommand cmd = new SqlCommand("sp_getOutDCmaterialDetail",con1);
           cmd.CommandType = CommandType.StoredProcedure;
           cmd.Parameters.AddWithValue("@outDCid", txtOutId.Text);
           cmd.Parameters.AddWithValue("@inwordItem", inworditem);
           SqlDataAdapter da = new SqlDataAdapter(cmd);
           DataSet ds = new DataSet();
           da.Fill(ds);

          //.Text = ds.Tables[0].Rows[0][0].ToString();
           con1.Open();
           //SqlDataReader dr=cmd.ExecuteReader();
           //if (dr.HasRows)
           //{
           //    while (dr.Read())
           //    {

           //    }
           //}

           gvOutDCItemDetails.DataSource = ds;
           gvOutDCItemDetails.DataBind();

           OutDCItemDetails.Visible = true;


       }
   }

  protected void gvOutDCItemDetails_RowDataBound(object sender, GridViewRowEventArgs e)
   {
       if (e.Row.RowType == DataControlRowType.DataRow)
       {
           //if ((e.Row.RowState & DataControlRowState.Edit) > 0)
           //{
               DropDownList ddList = (DropDownList)e.Row.FindControl("ddrProcess");
               //bind dropdownlist

               SqlCommand cmd = new SqlCommand("sp_getProcess", con1);
               cmd.CommandType = CommandType.StoredProcedure;
               SqlDataAdapter da = new SqlDataAdapter(cmd);
               DataSet ds = new DataSet();
               da.Fill(ds);
               DataTable dt = ds.Tables[0];
               //DataTable dt = con1.GetData("Select category_name from category");
               ddList.DataSource = dt;
               ddList.DataTextField = "PName";
               ddList.DataValueField = "Process_Id";
               ddList.DataBind();
               ddList.Items.Insert(0,new ListItem("--SELECT--","0"));

               TextBox txtDispatchQuantity = (TextBox)e.Row.FindControl("txtDispatchQuantity");
               txtDispatchQuantity.Text = ds.Tables[0].Rows[0][3].ToString();

               TextBox txtRamainingQuantity = (TextBox)e.Row.FindControl("txtRamainingQuantity");
               txtRamainingQuantity.Text = ds.Tables[0].Rows[0][3].ToString();

               TextBox txtRate = (TextBox)e.Row.FindControl("txtRate");
               txtRate.Text = ds.Tables[0].Rows[0][3].ToString();


               TextBox txtAmount = (TextBox)e.Row.FindControl("txtAmount");
               txtAmount.Text = ds.Tables[0].Rows[0][3].ToString();


               }
       if (e.Row.RowType == DataControlRowType.Footer)
       {

         //  Label lblTotalPrice = (Label)e.Row.FindControl("Total_Amount");

           //lblTotalPrice.Text = total.ToString();
          // txttotalAmount.Text = Total.ToString();
       }

   }


for update record in my OutWordChallan Page
On selectedindexchaged i want to set vaues of textbox in item template of gridview ...
using dataset ...
but how can i assign vaues when we actually dont know how many rows in my dataset
please help me thr this
really thankfull

Questionhow t send usper 100 request to a crystal report for tesing report performance Pin
mhd.sbt9-May-14 2:30
mhd.sbt9-May-14 2:30 
AnswerRe: how t send usper 100 request to a crystal report for tesing report performance Pin
V.11-May-14 20:42
professionalV.11-May-14 20:42 
Questionhow to bind data from database to option in classic ASP Pin
Ye Htut7-May-14 18:06
Ye Htut7-May-14 18:06 
AnswerRe: how to bind data from database to option in classic ASP Pin
Peter Leow7-May-14 18:42
professionalPeter Leow7-May-14 18:42 
Questionhow to make dropdownlist select manually inserted value Pin
Nico Haegens7-May-14 0:55
professionalNico Haegens7-May-14 0:55 
AnswerRe: how to make dropdownlist select manually inserted value Pin
Shameel7-May-14 1:23
professionalShameel7-May-14 1:23 
AnswerRe: how to make dropdownlist select manually inserted value Pin
Nico Haegens7-May-14 1:38
professionalNico Haegens7-May-14 1:38 
QuestionControl to be focused on postback Pin
Kandepu Rajesh5-May-14 22:47
Kandepu Rajesh5-May-14 22:47 
AnswerRe: Control to be focused on postback Pin
Tom Marvolo Riddle6-May-14 0:04
professionalTom Marvolo Riddle6-May-14 0:04 
GeneralRe: Control to be focused on postback Pin
Kandepu Rajesh6-May-14 0:12
Kandepu Rajesh6-May-14 0:12 
GeneralRe: Control to be focused on postback Pin
Tom Marvolo Riddle6-May-14 0:54
professionalTom Marvolo Riddle6-May-14 0:54 
AnswerRe: Control to be focused on postback Pin
jkirkerx8-May-14 12:09
professionaljkirkerx8-May-14 12:09 
QuestionSwitching from PHP to ASP.NET Pin
Daniel Lieberwirth (BrainInBlack)4-May-14 22:38
professionalDaniel Lieberwirth (BrainInBlack)4-May-14 22:38 
AnswerRe: Switching from PHP to ASP.NET Pin
Peter Leow4-May-14 23:16
professionalPeter Leow4-May-14 23:16 
GeneralRe: Switching from PHP to ASP.NET Pin
Daniel Lieberwirth (BrainInBlack)4-May-14 23:25
professionalDaniel Lieberwirth (BrainInBlack)4-May-14 23:25 
AnswerRe: Switching from PHP to ASP.NET Pin
thatraja4-May-14 23:19
professionalthatraja4-May-14 23:19 
GeneralRe: Switching from PHP to ASP.NET Pin
Daniel Lieberwirth (BrainInBlack)4-May-14 23:29
professionalDaniel Lieberwirth (BrainInBlack)4-May-14 23:29 

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.