Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Editable Grid view

Editable Grid view

Scheduled Pinned Locked Moved ASP.NET
csharpcssasp-netdatabasequestion
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hari4ur
    wrote on last edited by
    #1

    Hai friends, I need some information about editable gridview, Please provide. My question is i am sending text into one field of database with comma(,) seperated. I want to retrive that field into editable gridview with different rows each comma seperated word. i need a editable gridview without showing edit button in asp.net. Thanking You, Harinath

    S V 2 Replies Last reply
    0
    • H hari4ur

      Hai friends, I need some information about editable gridview, Please provide. My question is i am sending text into one field of database with comma(,) seperated. I want to retrive that field into editable gridview with different rows each comma seperated word. i need a editable gridview without showing edit button in asp.net. Thanking You, Harinath

      S Offline
      S Offline
      Sathesh Sakthivel
      wrote on last edited by
      #2

      Editable Grid View[^]

      Regards, Satips.:rose:

      H S 2 Replies Last reply
      0
      • H hari4ur

        Hai friends, I need some information about editable gridview, Please provide. My question is i am sending text into one field of database with comma(,) seperated. I want to retrive that field into editable gridview with different rows each comma seperated word. i need a editable gridview without showing edit button in asp.net. Thanking You, Harinath

        V Offline
        V Offline
        Venkatesh Mookkan
        wrote on last edited by
        #3

        hari4ur wrote:

        I want to retrive that field into editable gridview with different rows each comma seperated word.

        You have to do manually.

        hari4ur wrote:

        i need a editable gridview without showing edit button in asp.net

        You can trigger the EditCommand using the JavaScript on the click of each row.

        Regards, Venkatesh Mookkan. Software Engineer, India My: Website | Yahoo Group | Blog Spot

        1 Reply Last reply
        0
        • S Sathesh Sakthivel

          Editable Grid View[^]

          Regards, Satips.:rose:

          H Offline
          H Offline
          hari4ur
          wrote on last edited by
          #4

          Hai Thanks for providing your suggesion bye

          1 Reply Last reply
          0
          • S Sathesh Sakthivel

            Editable Grid View[^]

            Regards, Satips.:rose:

            S Offline
            S Offline
            sarthakm
            wrote on last edited by
            #5

            .style1 { width: 119%; } .style2 { width: 119%; height: 16px; } .style14 { width: 164px; }

            S 1 Reply Last reply
            0
            • S sarthakm

              .style1 { width: 119%; } .style2 { width: 119%; height: 16px; } .style14 { width: 164px; }

              S Offline
              S Offline
              sarthakm
              wrote on last edited by
              #6

              <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="assignment._Default" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript"> var TotalChkBx; var Counter; window.onload = function () { TotalChkBx = parseInt('<%= this.grdEmployees.Rows.Count %>'); Counter = 0; } function HeaderClick(CheckBox) { var TargetBaseControl = document.getElementById('<%= this.grdEmployees.ClientID %>'); var TargetChildControl = "chkBxSelect"; var Inputs = TargetBaseControl.getElementsByTagName("input"); for (var n = 0; n < Inputs.length; ++n) if (Inputs[n].type == 'checkbox' && Inputs[n].id.indexOf(TargetChildControl, 0) >= 0) Inputs[n].checked = CheckBox.checked; //Reset Counter Counter = CheckBox.checked ? TotalChkBx : 0; } function ChildClick(CheckBox, HCheckBox) { //get target control. var HeaderCheckBox = document.getElementById(HCheckBox); //Modifiy Counter; if (CheckBox.checked && Counter < TotalChkBx) Counter++; else if (Counter > 0) Counter--; //Change state of the header CheckBox. if (Counter < TotalChkBx) HeaderCheckBox.checked = false; else if (Counter == TotalChkBx) HeaderCheckBox.checked = true; } function isDelete() { return confirm("Do you want to delete this row ?"); } </script> </head> <body> <form id="form1" runat="server">

              <%--for grid--%>

              S 1 Reply Last reply
              0
              • S sarthakm

                <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="assignment._Default" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript"> var TotalChkBx; var Counter; window.onload = function () { TotalChkBx = parseInt('<%= this.grdEmployees.Rows.Count %>'); Counter = 0; } function HeaderClick(CheckBox) { var TargetBaseControl = document.getElementById('<%= this.grdEmployees.ClientID %>'); var TargetChildControl = "chkBxSelect"; var Inputs = TargetBaseControl.getElementsByTagName("input"); for (var n = 0; n < Inputs.length; ++n) if (Inputs[n].type == 'checkbox' && Inputs[n].id.indexOf(TargetChildControl, 0) >= 0) Inputs[n].checked = CheckBox.checked; //Reset Counter Counter = CheckBox.checked ? TotalChkBx : 0; } function ChildClick(CheckBox, HCheckBox) { //get target control. var HeaderCheckBox = document.getElementById(HCheckBox); //Modifiy Counter; if (CheckBox.checked && Counter < TotalChkBx) Counter++; else if (Counter > 0) Counter--; //Change state of the header CheckBox. if (Counter < TotalChkBx) HeaderCheckBox.checked = false; else if (Counter == TotalChkBx) HeaderCheckBox.checked = true; } function isDelete() { return confirm("Do you want to delete this row ?"); } </script> </head> <body> <form id="form1" runat="server">

                <%--for grid--%>

                S Offline
                S Offline
                sarthakm
                wrote on last edited by
                #7

                public partial class _Default : System.Web.UI.Page { StringBuilder StrBuilder; ClsHBC_Bl ObjHbcBL; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ObjHbcBL = new ClsHBC_Bl(); DataTable dt = new DataTable(); dt = ObjHbcBL.GetEmployees_BL(); ViewState["dt"] = dt; grdEmployees.DataSource = dt; grdEmployees.DataBind(); } } protected void BindGrid() { grdEmployees.DataSource =(DataTable) ViewState["dt"] ; grdEmployees.DataBind(); } protected void BtnDelete_Click(object sender, EventArgs e) { GridViewRow gvRow = (GridViewRow)(sender as Control).Parent.Parent; Label1.Text = "hi"; } protected void grdEmployees_RowCommand(object sender, GridViewCommandEventArgs e) { } protected void grdEmployees_SelectedIndexChanged(object sender, EventArgs e) { } protected void Button_click_event(Object sender, EventArgs e) { Label1.Text = "Hello"; } protected void grdEmployees_RowDataBound(object sender, GridViewRowEventArgs e) { } protected void grdEmployees_RowDeleting(object sender, GridViewDeleteEventArgs e) { int cEmployeeID = (int)grdEmployees.DataKeys[e.RowIndex].Value; ObjHbcBL.DeleteEmployee_BL(cEmployeeID); } protected void btnUpdate_Click(object sender, EventArgs e) { StrBuilder = new StringBuilder(string.Empty); StringWriter stringWriter = new StringWriter(StrBuilder); CheckBox CC; DataSet ds = new DataSet(); DataTable dt = new DataTable("toUpdate"); dt.Columns.Add("EmpId", typeof(int)); dt.Columns.Add("ContactNo", typeof(String)); dt.Columns.Add("Experience", typeof(String)); dt.Columns.Add("Skill", typeof(String)); ds.Tables.Add(dt); for (byte i = 0; i <= grdEmployees.Rows.Count-1; i++) { CC = (CheckBox)grdEmployees.Rows[i].FindControl("chkBxSelect"); if (CC.Checked)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups