Edit GridView without template control

 I have a gridview but need to bulk edit the gridview via a event from a button.  Not sure how to go about doing that.  Any examples or ideas? 

 

Thanks,

0
Jarhead88
12/4/2008 10:00:10 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

6 Replies
784 Views

Similar Articles

[PageSpeed] 56
Get it on Google Play
Get it on Apple App Store

 http://www.gridviewguy.com/ArticleDetails.aspx?articleID=219_GridView_All_Rows_in_Edit_Mode


Give a man a fish and you feed him for a day. Teach a man to fish and you feed him forever.
0
ramireddyindia
12/5/2008 3:59:12 AM

 Yeah I tried that or something similar and could not get it to work.  When it binds back to the grid its empty and not a textbox. 

0
Jarhead88
12/5/2008 9:37:04 PM

 can you show us the code what you tried? so that we will do necessary modifications.


Give a man a fish and you feed him for a day. Teach a man to fish and you feed him forever.
0
ramireddyindia
12/6/2008 3:40:24 AM

Here is the code behind.  the html code is same as article just name differently.  It hits the edit fine but when rebinding it never chgs it to text box.  

protected void Page_Load(object sender, EventArgs e)
    {


        if (!Page.IsPostBack)
        {
            User usr = ((IRISPage)this.Page).UserObj;
            GroupInfo group = new GroupInfo("OISAPP");

            if (group.IsMember("tktdet", usr.UserName))
            {
                BindData();

            }
            else
            {
                form1.Visible = false;
                //NotAuthorized.Visible = true;
            }

        }
    }
    //Edit button
    protected void btnedit_Click1(object sender, EventArgs e)
    {
        this._visible = true;
        
        
        BindData();
        //GridView1.DataBind();
    }

    //Update button
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        for (int i = 0; i < GridView1.Rows.Count; i++)
        GridView1.UpdateRow(i, true);
        _visible = false;
        GridView1.DataBind();
            

    }

0
Jarhead88
12/6/2008 5:48:44 AM

 And here is the Bind method just in case your needing it. 

  protected void BindData()
    {
        DataTable tempTable1 = objConnClass.FillGrid(lblDate.Text, lblDate2.Text, txtEventID.Text, strb.ToString());
        if (tempTable1 != null)
        {
            GridView1.DataSource = tempTable1;
            GridView1.DataBind();
        }

    }

0
Jarhead88
12/6/2008 5:51:43 AM

Hi Jarhead88,

In btnUpdate_Click1 event you also need to set data source to GridView1. It will not display any data to only call DataBind() method for GridView, if the data source is customized such as DataTable.

Thanks,


Qin Dian Tang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Qin
12/9/2008 8:36:20 AM
Reply:

Similar Artilces:

Add new controls to a gridview row; when editing that row using the edit row feature in the gridview control.
Hi all  I have a questions that looks hard / complex to me, and i know you can help me in this. Q {  I have row in a Gridview and i have an edit option to it. I press the edit button, to edit the values in that row and update data all the way back to the database. Now when i press the edit button, i want a drop down list to be displayed that contain values for a particular field in my grid view. (for now only plain text boxes appear.) } I hope you understand my question, all i need to do is replace the text box controls with a dropdown list when i am editing a row in ...

using javascript getting value from textbox when edit button is clicked and both controls are present in gridview control
Hi All using javascript I want to get value  from textbox when edit button is clicked and both controls that is texbox and button are present in gridview control .Alok Hi aloksinha83, Please see this post: http://forums.asp.net/t/1069245.aspx Thanks,Qin Dian TangMicrosoft Online Community SupportPlease remember to mark the replies as answers if they help and unmark them if they provide no help....

gridview control in another gridview control
Hi ia have a questioni have a gridview control which contains button in one colum.now my question is i need another gridview to be placed in the  first gidviewso that when i click on the button the second gridview will populate the data.now my question is how to place second gridview in first gridview.or is there any approach like first grid itself acting as parent and child.please help me  Hi sirikalavalapalli:                I think nested gridview will help you. Check this link and it will show you how...

Direct editing of gridView or Ddatagrid controls without clicking on an EDIT link
I have an application where lots of data is presented to the user in a gridView control and the user needs the option to review and overwrite any values in the cells of the grid.  My users find it very annoying and time consuming to click on an edit link to turn a row of the gridView into edit mode.  Typically, they might jump around and edit a few values in several rows.  Is there any way to present the data in a gridView control, datagrid control or something that looks like a grid where the entire grid is already in edit mode?  Can you make a grid that cont...

Getting the control id of a control inside gridview control
 uhmm.. a little bit confusing regarding my subject because i dont know how to say it...by the way my problem is how can i get the id of a control (e.g. textbox) inside the gridview... and the textbox is in the templatefield... is there any way i can get its id??  hoping i could get a reply as soon as possible... Regards,MhaeyPlease remember to click “Mark as Answer” on the post that helps you.. =) What do you want's to do by getting the id of the Text box? Do you want's to find particular Textbox with certain id ? Kamran ShahidSr. Software Engineer(MCP,MCAD.net,MC...

Edit data with GridView Control ? or another control ? help
I use GrivView in ASP.Net 2.0 to show data from DataTable. And i want to edit some fields in some rows. How can I do it? If i touch EDIT button - all columns, which have ReadOnly=false, switch into EDIT mode. But I want, that in first raw I can edit 2,3 column and in second row only 3 column. How can I do it ? ...

How do I access control on edit item template in DataView control?
I have a DataView control. I have a Template Field named MyNewTemplateField and in it's Edit Items Template I have a text box called "txtMyTextBox", which I want to do something with the data typed in, and then take that result and put it in the Access database.  Protected Sub DataView1_ItemCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewCommandEventArgs) Handles dvAcct.ItemCommand Select Case e.CommandName Case "Edit" Dim txtTheText As New TextBox txtTheText = DataView1.FindControl("txtMyTextBox"...

Handling control events while in edit mode for a gridview control
I have a dropdownlist and checkbox in a single column of a gridview. While the row is in edit mode, I want to set the visibility of the checkbox based on the value selected in the dropdown list. I can do this easily enough  when the row is first put into edit mode, but how do I access the dropdown list's change event when the row is already sitting there in edit mode? Thanks for any help you can provide.   Penny Penny, Just create a SelectedIndexChanged event like below. Create a row object for the currently edited row, find the checkbox you want to control, then set the Visib...

How to add values to template control fields textbox control in GridView..
Hi all,    <asp:GridView ID="GridView1" EnableViewState="true" DataKeyNames="LicenseTemplateID"                       runat="server" AutoGenerateColumns="False" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"                       Width="345px">                       <Columns>                           <asp:Templa...

How to use WebPartZone control in gridview control's template?
I Need Your Help To Solve The Following Problem.Thanks. I want to use WebPartZone control (NOT ATLAS) like this:         <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">            <Columns>                <asp:TemplateField HeaderText="templatecol">                    <ItemT...

Setting UpdatePanel Trigger control ID to GridView template control
I have a linkbutton control inside a template column of a gridview control. I'm trying to use that as a trigger to update an updatepanel control on the page, however atlas can't find the control by the simple ID "linkButton1". Is there a syntax that will allow me to specify the LinkButton control inside the gridview column template? I don't think you can setup your trigger that listens for the linkButton itself because when the grid is rendered each linkbutton on each row will be given a unique ID by .NET.  For example, if in the template definition you...

Help Req: !!! :- On Disabling Controls Present inside a Gridview control
Hi All, We have A requirement Where we have disable controls inside a grid.These controls can be textbox, DropDownlist (in TemplateField), ComandField present inside the grid.We have to call a generic method for doing the same .(since it can be done for multiple grid.) PFB the code snippet we use. Which disables all the controls inside the page.The bolded part of the code is used to loop inside a grid view.(Not Working.)Is this ideal way to deal with the requirement.Or can someone suggest be a better way.        public void DisableMe(Page p1, st...

Gridview control embedded in another gridview control
I am writing an ambulance crew scheduling application on the web and I need some help completing the last part.  I have an access database that has three tables: user table, shift table (describing the shifts available), and a schedule table (that stores shift by shift_id and user by user_id).  I have a gridview control that will display the available shifts but I cannot get the embedded gridview control that will display the user that is signed up for each shift to display because I cannot figure out how to use the OnRowDataBound method.  I need a simple VB example of how to...

Getting/Updating and Binding a Control in the Edit Template of a Grid View Control
 Hi,               I am curious how do I update (or data bind) a drop down list in the edit template of a Grid View Control.             My problem is that in the GridView_RowEditing() method, the drop down list does not seem to exist. It only appears when the DropDownList_DataBound() method gets called. I can get the data for the DropDownList and attempt to bind it in this method, but then calling the DropDownList.DataBind()calls DropDownList_DataBound(), a...

Web resources about - Edit GridView without template control - asp.net.presentation-controls

GridView SelectedItem Binding Gotcha in WinRT
Last night when I was doing some WinRT hacking I was trying to setup databinding to the selected item in the GridView control and I ran into ...

CNW Group
Home Services Beyond the Wire About CNW Financials Webcasts Events My CNW All News Releases Advanced Search Gridview Latest News Releases All ...

CNW Group
... Services Beyond the Wire About CNW my CNW CNW Access CNW Directories Financials Webcasts Events my CNW All News Releases Advanced Search Gridview ...

CNW Group
Home Services Beyond the Wire About CNW Financials Webcasts Events My CNW All News Releases Add a Filter Gridview Latest News Releases All Today ...

New CmdLets of Powershell 2.0
New CmdLets of Powershell 2.0

Price Drop: Softbox
... objects- create product reflection- changing the background with something more interestingUse it as:- softbox- honeycomb softbox- gridview ...

Profile.aspx: ASP Alliance
.NET,ASP,ASP.NET,SQL,XML,HTML,ADO,ADO.NET,JavaScript,JScript,CSharp,VBScript and VB tutorials from AspAlliance.

Quick Answers - CodeProject
Questions - Free source code and tutorials for Software developers and Architects.; Updated: 25 Oct 2012

DotNetKicks.com - Upcoming stories
DotNetKicks.com is a community based news site edited by our members. It specialises in .NET development techniques, technologies and tools including ...

View Features - ExtendASP
Call 847-681-9827 or Request a Demo View Features Testimonials Pricing About Us Coming Soon ExtendASP exposes every feature, more than any other ...

Resources last updated: 1/7/2016 9:07:53 AM