.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Gridview updation of Record

Posted By:      Posted Date: September 26, 2010    Points: 0   Category :ASP.Net

i have bind griview dataSource with Store procedure having join of 3 table how can i update this gridview data using stored procedure?...

I am waitng...

View Complete Post

More Related Resource Links

GridView inline Master/Detail record display

This code drop is part of a smash and grab series. If you're in a rush, you can just grab this code and insert it into your application, no understanding is required. When you have some time (ya, right) you may want to review the source code.

Gridview Edit on Searching of Record


using Asp.net c#

sql server

i am searching a record from my database and displaying it in gridview now i want the comments should be updated as per the record which is being searched

For E.g if record No.3 is searched then only i can update record no.3 and i don't want rest of data to be shown

now what is happening when i click on edit my whole table is being displayed

this is bcuz i made one method gridfill() which i m calling everytime if i m doing grid row editing,row cancelling and row updating

how i can resolve this thing

my code

 protected void GridView2_RowEditing(object sender, GridViewEditEventArgs e)
        GridView2.EditIndex = e.NewEditIndex;


 protected void GridView2_RowUpdating(object sender, GridViewUpdateEventArgs e)
        string id = GridView2.Rows[e.RowIndex].Cells[0].Text;
        TextBox t;
        t = (TextBox)GridView2.Rows[e.RowIndex].Cells[2].Controls[0];
        string query = "update user1 set comments=@comments where id=@id";
        SqlConnection con = new SqlConnection(connstr);
        SqlCommand cmd = new SqlCommand(query, con);

Edit gridview record on 2 rows



Is that possible to edit a record within a gridview on 2 rows to make it look better when editing?

Like I have 8 columns in my gridview.

I wish to have 4 columns on row one and the 4 remaining columns on row 2.


email to each record in gridview

I have a gridview that is populated from a selection made from a DropDown list box. I would like to click a check box then send an email to each record in the gridview. Could someone offer some solid help on how to do this?       Thank you for your input.

Update Database Record using GridView and Stored Procedure

Hi, I am trying to update record via stored procedure, but i got error at very start point. Problem is when i click on Edit link button within the Gridview it produce error. I can populate values from database fine but its produce error when i click on edit link button. Please see the code below. *********** ASP.net GridView Code I am using *****************<asp:GridView ID="GridView1" runat="server" DataKeyNames="RollID, EmpID" AutoGenerateColumns="False" Width="700px"> <Columns> <asp:TemplateField HeaderText="ApplicationID" Visible="false"> <ItemTemplate> <asp:Label ID="AppsID" runat="server" Visible="false"><%# Eval("RollID") %>'</asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="ReleaseID" Visible="false"> <ItemTemplate> <asp:Label ID="rlsID" runat="server" Visible="false"><%# Eval("EmpID") %></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Roll Name"> <ItemTemplate> <asp:Label ID="rlsVersion" runat="server"><%# Eval("Roll_Name")%></asp:Label> </ItemTemplate> <EditI

Print a specific Access Report with selected GridView record

I have my code output a gridview with all the data with an option to select records. I'm trying to make a code which would allow me to select a record, and then print this record using a specific Report stored in MS Access. I've located the code to print the Report it self, but it prints ether all the records or a range. Any ideas? 

Gridview data Updation


How can we edit update  gridview data in gridview  using  stored procedure asp.net c#

Gridview Record Update Problum


How can I Edit and update record in Gridview using viserd..

in asp.net c#

Updation in gridview using Ajax XmlHttp Object does't work



I have many divs in 1 page and each div consists of a gridview, the gridview is loaded by making AJax calls.

On load of the page, all the grid load data properly.

But now when i update any row in either of the grids, and make a call to the javascript that loads the grid in the page, it doesn't work rightly.

Any advices. Am i doing something wrong.

Wat are the options to update/refresh the grid.


Maximize page when new Record in GridView


Hi All,

I am trying to to maximize / focus the page when i get new record in my GridView, for this i put the timer to but i can i can see it is nit firing under the timer.

Here is my code.

function maximize() {
  window.moveTo(0, 0);
  window.resizeTo(screen.width, screen.height);

 Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles Timer1.Tick

	Me.ClientScript.RegisterStartupScript(Me.GetType(), "", "<script language=javascript>maximize();</script>")
        If GridView1.Rows.Count.ToString > Session("total_Row") Then
	     'Me.ClientScript.RegisterStartupScript(Me.GetType(), "", "<script language=javascript>maximize();</script>")
            Session("total_Row") = GridView1.Rows.Count.ToString
        End If

    End Sub

And i am calling RegisterStartupScript outside of timer for the example on push button event it works well. But inside timer it is not firing...

I will appriciate for your suggestions.


New Record Button for FormView when GridView on same form


I have a GridView and FormView on the same form - it all seems to work OK connected up together.

How can I offer the user a "New Record" button / link directly when they hit the page? At present it's only when they select a record from the grid that a New link appears.

Also on  a related note, if the user deletes a record, I have the grid refreshing, but the deleted record stays put on the formview - can I refresh this, or lose the formview until they select another record from the Grid?


How to hide a gridview when no new record entered


In my aspx page, I have a formview and a gridview. I am using the insert template of the form to insert an application number and applicant name both of which the user will enter.

I have a insert stored procedure that checks if that same number exist, it won't enter one, if not it will. ID of that table is autoincrement.

If a new number entered, it should show in the gridview as in my query I am asking to show the max ID. The applicatin number in the grid is a hyperlink which allows the user to go to a details page.

My problem: Whenever I click the save button in the formview, the grid becomes visible with the last created number. It is ok if the system allow to enter a new record. But if the number is a duplicate and the system does not enter a new number, still the grid shows with the last created number.

How can I implement what I want to do.

The stored procedure is:

ALTER PROCEDURE [dbo].[InsertNewChurchApp]nvarchar

Dropdown List in Gridview - While saving the record in gridview the droppdown selected index are cha



I am developing page for maintaing employee record using Visual Studio 2008, MS SQL server 2005.

I am able to fetch and display all the employee information in gridview, the gridview have the dropdown list to display the employee type [ Part Time, Full Time, Permanent , Contract ], in the item template i am having dropdown list. IN the dropdown list i am displaying this.

But While saving the record in gridview the droppdown selected index are changed to 0 of other dropdown list.

the user may be change the dropdown value from permanent to contract, or so. but while click on the save button in gridview, all the previous selection are gone, and always showing the first record of dropdown list. I know this is happening because we are doing dropdown list bind on onRowDataBound.

But i want to retain all the user selection in gridview, please help me how to do this.

thanks in advance.

Getting First record in Nextpage and last record of previous page of gridview



I am using paging to my  gridview (pagesize=4) . now i am in  (X) page and i want to get  (X+1) page top record or (X-1)page  bottom record , how i can get .


Inplace Edit in GridView

In this article I am presenting a different way to look at EditItemTemplate, using which user navigation for editing is reduced and . it looks very different (see screeen shots) then regular implementation of GridView.

GridView Confirmation Box Using JQuery BlockUI in asp.net

JQuery is the most popular JavaScript library. One of the main reasons for its fame is the plugin architecture. Anyone can create a separate library that leverage the JQuery library. In this article we are going to look at the BlockUI library which is used to block the user screen while performing a task.

Textbox Editable GridView in ASP.NET

This article describes how I made a fully editable gridview in C# using ASP.NET 2. The idea is that the GridView looks and works like an Excel spreadsheet. You see all the cells in the table, and you can edit any of the cells you like, and they are automatically updated (i.e. saved to the database). This is very often how people expect data tables to work in web pages, and I've often seen people clicking in vain on un-editable gridview cells, somehow expecting to edit them, and not understanding that they need to click an Edit button at the end of the row.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend