is there anyway to show edit button only for selected row in gridview
now if i click on select button edit button will show for all rows but i want to display edit button only for selected row
View Complete Post
using Asp.net c#
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
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.Text;
t = (TextBox)GridView2.Rows[e.RowIndex].Cells.Controls;
string query = "update user1 set comments=@comments where id=@id";
SqlConnection con = new SqlConnection(connstr);
SqlCommand cmd = new SqlCommand(query, con);
I've got a gridview I would like to let the user edit a couple of columns. Seems like everything I'm coming across so far makes the entire row editable.
Hopefully the solution isn't too complicated. Can someone point me in the right direction?
My project includes a grid view which displays information of inventory items (Assets), data is quried from AssetTable. The GridView has a command field to allow editing, below is a description of the tables and how data is displayed
BuildingTable: (BuildingID, BuildingName)
ItemTemplate: Using a LINQ query I join the two table and displays in a label control a string which includes BuildingID and BuildingName (5 North Building)
EditItemTemplate: Using a LINQ query I populate a DropDownList with strings of BuildingID and BuildingName same as above.
Here issue which I need to resolve:
1. ItemTemplate display the correct information (BuildingID BuildingName) but when I switch to EditItemTemplate the pair that is
displayed is the first one on the list, how do I make is scroll to the item which was displayed in the label ?
<asp:CommandField ShowEditButton="True" >
i have a gridview and i want to perform edit and delete with an image button
but unable to figure out the events and how i m gonna make my grid into edit mode ??
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
<asp:Label ID="Label1" runat="server" Text='<%# Container.DataItemIndex+1 %>'></asp:Label>
<asp:ImageButton ID="ImageButton1" runat="server" ImageAlign="Middle"
I have a gridview that I can't for the life of me get the datepicker calender to pop up for. I've been using the datepicker for months very successfully for a variety of textboxes on the page and inside of formviews but this is the first time I've tried using with gridview. I didn't expect any issues however can't seem to find anything to work. I have searched the forums for 2 days and attempted any suggestions found within the solutions to no avail. I've tried using the CSS to link the datepicker but everything stopped working when I changed the code and my page which uses a css style already got all distorted looking. Please help!
Here is my gridview (only included a part b/c it is large and am only having problem with the datepicker for the date completed text box)
<asp:GridView ID="GridViewCompleted" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid"
BorderWidth="3px" CellPadding="4" DataKeyNames="job_id" DataSourceID="SourceJobProjectCompleted"
I want to set up a gridview that will display data like this
WeekEndingDate Project Category Sun Mon Tues Wed Thu Fri Sat8/14/2010 proj1 test 2 1 2 3 2 1 0 8/21/2010 proj1 test 0 2 2 2 2 1 0 8/28/2010 proj1 test 0 1
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.