How to get the data of a particular row in gridview without editing that row.

I have a gridview in a page in that ihave hyperlink as one column on click of that i want to go next page with the data present in that corresponding row.

How shell i read the data from grid view for that pirticular row.On which event i can get the data.

0
chandra
11/12/2007 9:06:24 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

2 Replies
1052 Views

Similar Articles

[PageSpeed] 2

HI, the row that is selected should be passed into a string or an array or in sessions

this can be done through this code

  protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
        Label _lbl = new Label();
        _lbl = (Label)GridView1.Rows[e.NewSelectedIndex].Cells[0].FindControl("Label1");
        Session["myname"] = _lbl.Text;
    }

by this code u will get the value that u wanted to select from the grid

then depending on the details u can develop the remaining

Please mark as correct if it helps 

0
azam841
11/12/2007 9:26:00 AM

hi

there is an example on master details (separate pages ) in this quickstarts

see how they use the hyperlink field to redirect to details page,,, without any code..

 


Regards,

Anas Ghanem.


Note:Please Don't hesitate to click "Report Abuse" link if you noticed something wrong on the forums (like duplicate ,Off-topic,offensive,or any post that violates the website "TERMS OF USE"). -- Thanks!

0
anas
11/12/2007 10:31:44 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 ...

Data Controls insert rows into gridview then insert rows from gridview into SQL Table
Hello there, I'm still new at performing miracles with code . Currently I am having trouble with my latest coding adventure I have a web application which records jobs and labour assigned to jobs. The issue in particular I'm having is the way in which labour is to be assigned. I want to use standard controls (Textbox, Dropdownlist) to record the values into a gridview (ie,put multiple rows into the gridview using the controls). Then, when all the inserting is complete, the user clicks a submit button to insert all the rows from the gridview into a database table. The reason for...

Gridview row editing fields based on row data
Is there a way to change row editable fields in a databound gridview based on the rows data. For example letting a user edit all his and his fellows fields but preventing him from changing specific fields in his boss data on the same gridview? Help will be great fully appreciated. Thanks If I understand what you are saying is that you want to only allow a user to Edit certain rows within the GridView. If so, yes, you certainly can do this. What I would do is hide/display the Edit Button for a row based on the user's role or permissions. This can easily be done via the RowDataBound e...

How to delete row from GridView control
Hello,  I am working on an ASP.NET 2.0 app, and I am trying to wire up a "Delete" button to a gridview control on a form. Here is the code for the ASP :  <asp:GridView ID="gvInConditions" runat="server" AutoGenerateColumns="true" OnRowDeleting="gvInConditions_RowDeleting" DataKeyNames="Condition_ID" >         <Columns>                <asp:CommandField ButtonType="Button" SelectText=&...

How to add a blank row into GridView Control, for editing and inserting data into database.
Dear all:      I show my data in browser with ObjectDataSource and GridView .The GridView have Edit,Select,Update functions.However ,I have an idea that: if I click some button, the GridView Control can add one blank row in its bottom where I can Edit data and Insert these data into database.I don't know whether the GridView Control  have these function.      Please give me some advise.      Thanks a lot! The GridView don't support Insert. Take a look at th...

Allow editing of all rows simultaniously (without having to click edit/update for each row)?
I have an application where the user will be presented with perhaps 20 rows.  1 field of each row (the score) will need to be updated by the user.   Now with a gridview they would click on the first row's EDIT button then make the change for the Score field and then click update. Having to do this ~20 times would be somewhat annoying for the user :)  Is there any way I can get an Excel like behavior where the user can just click on the first row's Score field then enter the integer score and hit tab or down arrow or something and drop down to the next one and keep on moving until they are all edited? Similar to how in VS 2008 in the Server Explorer tab you can go Show Table Data and then all the fields let you edit them by just clicking on them?   Yeah, look at putting textboxes in the control instead of labels and handling the saving programmatically.  You should be able to do everything programmatically with the GridView control except custom paging.... then you would have to extend the control and throw in your own paging control to store the "vitrualitemcount".Joseph Baggetthttp://www.myitstudio.com MCSD, MCPD: Web Developer, MCITP: Database Developer, MCTS: SQL Server 2005, MCTS: .NET 2.0 Web Applications, MCTS: .NET Framework 2.0 Windows Applications, MCTS: .NET Framework 2.0 Windows Applications, MCAD, MCP If the project doesn't work, blame Scott Guthrie and/or refer to the problem solving flowsheet. O...

How to get data from database row by row
I try to get data from a database row by row, I am using DataReader, the return result is not I expected, don't know how to solve it. Here is my sample code: --------------------------------------------Dim commandText As String = "select * from customer "Dim con As New OleDbConnection("Data Source=c:\company.mdb;Persist Security Info=False; Provider=Microsoft.Jet.OLEDB.4.0;")Dim Cmd As New OleDbCommand(commandText, con)Dim reader As OleDbDataReader = Cmd.ExecuteReader()             Using con       &nbs...

Accessing GridView Data Row By Row
guys i have just started with asp.net i have a basic doubt, i have created a SQL datasource and a gridview associated with it now what i need to do is get all the data from my database n modify it further, for this i need to access each row of the gridview any ideas on how to do so? foreach(GridViewRow row in GridViewName.Rows) { you can interate like this..  }Better Post your code before asking some thing, some one. So that person helping u will understand u r problem ClearlyYahoo IM : dotnetrulerI am trying to keep Frequently Asked Questions in my blog  When u enable show...

Populate row by row data in gridview
Hi , How to populate the data row by row in grid view. For example: I wirte this code in .aspx page <asp:TemplateField HeaderText="COC Date of Calibration">                <EditItemTemplate>                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# COC_Date("strDate") %>'></asp:TextBox>       &nbs...

Is there a control that offers the same data presentation as a GridView, but allows users to copy and paste many rows/columns at once?
 Hi Is there a control that offers the same data presentation as a GridView, but allows users to copy and paste many rows/columns at once onto the grid? What I mean is some grid that 's as flexible as MS Excel grid for example.  Any suggestions will be very much appreciated.E The Repeater control is a highly customisable data presentation controlRohin.NET developerNever trust a computer you can't throw out a window. - Steve WozniakPlease remember to click on 'Mark as answer', if this post helped you......

How to Edit & update & Delete a particular row of Gridview with code in c# & without using SQLDataSource
Hi Everyone           i have to take a gridview and to do the following operation              1)Insert new row in gridview by click on Add New Button in gridview            2)Edit that new row            3)Update that new row           4)Delete That new row how to write code for this.plz help thanks & regards rakesh    ...

How to get row selected in Gridview and then to get the data from the cells in that Grid?
I have a gridview with about 30 rows of data. If someone selects a row in the grid(Clicking or double clicking) then I want to get the values in each column/cell in that row. Once I get those values, I want to populate other edit controls on my web form with the values selected from the row. So the big question here, is how to capture the row selected from clicking or double clicking. Then how to get the column cell items?   Clickable GridView Row http://www.codeproject.com/aspnet/DoubleClickGridviewRow.asphttp://www.gridviewguy.com/ArticleDetails.aspx?articleID=188http://aspadvice.com/blogs/joteke/archive/2006/01/07/14576.aspx  Hosam Kamel Remember to click on Mark as answer on the post that helped you This tells how to make the Grid clickable, but not how to retrieve data from the cells. How do I do that? You can use this to extract value from cell  lblData.Text = oGridView.Rows[0].Cells[0].Text; Hosam Kamel Remember to click on Mark as answer on the post that helped you You can get the Gridview1.selectindexBest RegardsJesseZhao(ZhaoGuang) Blog : Http://www.PinZui.cnE-Mail : jessz@live.comIM(Live Messager) : jessz@live.com...

copy data from excel row to gridview row
Hi All, I need to copy data from excel to asp.net gridview. I have to select a row and press Ctrl+C to copy from excel, then I have to paste it in Gridview. Thanks in advance. I dont think you can Copy and Paste data from Excel to Gridview.But you can export data from Excel to GridView control, please check the below articles.http://www.aspdotnetcodes.com/Importing_CSV_Database_Schema.ini.aspxhttp://www.aspdotnetcodes.com/SqlbulkCopy_Data_Transfer.aspxMarking a Reply as 'Answered', not only GAIN us some POINTS, but it also HELP others to find RIGHT solution....

Get row data of a GridView
Hi... I have a GridView. It contains a button as a button column. My requirement is when I select any button in a particular row the data in that particular row should be retrieved and should be added to another gridview. How can I achieve it.Any body Help me out..... Thanks in advance    HiPlease go through this below linkhttp://forums.asp.net/t/1234057.aspx This also talks same Thanks~Avinash desai~Software DeveloperBangalorePlease remember to click "Mark as Answer" on this post if it helped you. mrkk:Hi... I have a GridView. It contains a button as a b...

Edit GridView row data
When a user clicks on the "Edit" control, I need to copy the data before the row goes to Edit mode.  I am trying GridView_RowCommand Event but I can't assemble the code to copy the row data, or cells in the row, where the Edit control resides.  What Event do I use to do this and what code will copy the row that the "Edit" control was in? can u plz explain why do u need to copy row data before going to edit mode? I am working on a way to audit data changes.  I'm not sure of the best approach yet so I had to start somewhere.  I want to compar...

How to get the index of a particular row in gridview upon clicking on a particular command button
Problem statement: I want to implement some like this that whenever a user chooses or clicks on selected records and hit the a button called deleted selected, then it should delete all the selected records.  if you have a working code for doing this task i would be highly gratefull.. The code i am doing is as follow:protected void btnSelected1_Click(object sender, EventArgs e) {int counter, Id = 0; ArrayList arr = new ArrayList();for (counter = 0; counter < GVCustomers.Rows.Count; counter++) {CheckBox chkid; chkid = (CheckBox)(GVCustomers.Rows[counter].FindControl("chk...

ListView onclick edit row without Edit link problem (GridView worked...)
Hello,I was initially using a GridView to enable row editing when any element of the row was clicked.  I'm using this control inside an UpdatePanel for partial-page postbacks.  This was basically accomplished by: protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) {//... if (e.Row.RowType == DataControlRowType.DataRow) { string jsCommand = string.Format("if ({2} != {1}) __doPostBack('{0}','Edit${1}')", GridView1.ID, e.Row.RowIndex, GridView1.EditIndex); foreach (TableCell c in e.Row.Cells) { // OnClick enable the e...

Detecting Footer Row vs Data row in a gridview
Hello, I am trying to run validation controls using page pre-render in vb for a gridview where I have the insert in the footer of the gridview and updates in the individual rows. The Prerender will highlight the controls which have failed the validation. My problem is that when the Page prerender fires, I cannot figure out how to get the controls depending on whether it is an insert from the footer, or an update from a regular row in the Gridview. The insert from the footer works well, but the update from a Gridview row does not. Also I have got a formview in the gridviews empty templat...

how to get id of row from check box in gridview row
this is my gridview code   <asp:GridView ID="dgAssociatedAttributes" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical" Width="80%"> <FooterStyle BackColor="#CCCCCC" ForeColor="Black" /> <RowStyle BackColor="#EEEEEE" ForeColor="Black" /> <Columns>           <asp:Bound...

Gridview Rows Backcolor getting reset when selecting a row
I have a list of rows in my gridview that list one or more entries per date.  I have coded the RowDataBound event so that all of the rows for a given date have the same backcolor.  Day 1 is white, Day 2 is yellow, Day 3 is white, day 4 is yellow - where each day could have multiple rows.  On each row, I also have an Edit imagebutton that allows each row to be edited via a separate panel and not in-line grid editing.  When I click on the Edit imagebutton, I set the gridviews selectedindex to that row and then using the skin for the grid, the selected row backco...

How to get the row index of a selected row in listview control
Can someone please tell me how to get the index of a selected row in a listview.  <ItemTemplate> <asp:LinkButton runat="server" class="linkButton" id="xxxxx" Text='<%#Eval("documenttype") %>' CommandName="OpenFile" CommandArgument='<%#Eval("DocumentKey") %>'></asp:LinkButton></ItemTemplate>what you have to do is, in itemcommand event of ListView, you have to get the value of row indexif(e.CommandName == "corrospondingcommaandname"){           // here your code /// }Please Mark as Answred If This Blog has Helped You.RegardsMitesh Darjihttp://www.indianic.comhttp://www.mitatdotnet.blogspot.com check this Link:http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listview.itemcommand.aspx Please Mark as Answred If This Blog has Helped You.RegardsMitesh Darjihttp://www.indianic.comhttp://www.mitatdotnet.blogspot.com Mitesh_Darji:  <ItemTemplate> <asp:LinkButton runat="server" class="linkButton" id="xxxxx" Text='<%#Eval("documenttype") %>' CommandName="OpenFile" CommandArgument='<%#Eval("DocumentKey") %>'></asp:LinkButton></ItemTemplate>what you have to do is, in itemcommand event of ListView, you have to get the value of row indexif(e.CommandName == "corrospo...

How to set all rows in edit mode and how to save all rows again in GRIDVIEW
hi, I.m looking for: - a solution with vb-code to set all rows in the Gridview (Visual Webdeveloper 2005 professional) in edit-mode.- After Editing a value and leaving this cell by the TAB-button automaticly go to the next cell (next row)- After changing the values save them with one click...Can someone help me out here. Searched a lot but cannot find a good solution.Thanks in advance for respondingJohan  I think it's possible, but I don't recommend such an UI. It's not a good practice to have more than one rows in edit mode. The best practices suggest using inline...

Multiple grid rows per Data row in GridView
I have a dataset that is binded to a gridview. The dataset has 5 fields and a description. I want to display 1 row for the 5 short fields and 1 row underneath it for the description. (per record)   For example: ID Name  Surname Field3 Field 4 1   John     Smith      blah    blah     This is the long description for  John Smith spanning 5 cells 2   Peter    Parker     blah    blah     This is t...

Get row info when an imagebutton on that row is clicked in a gridview
This is my gridview:<asp:GridView ID="GridView1" runat="server>   <Columns>      <asp:BoundField ...>      ...      <asp:TemplateField>         <ItemTemplate>            <asp:ImageButton ID="Button1" ImageUrl=... runat="server" OnClick="Button1_Click" />         </ItemTemplate>    ...

Web resources about - How to get the data of a particular row in gridview without editing that row. - asp.net.presentation-controls

How Clinton Shadowboxed Trump at the Democratic Debate
Hillary Clinton may have been facing Bernie Sanders at Wednesday’s debate, but in reality she was shadowboxing Donald Trump. The Republican ...

Oculus Social launches on Gear VR, Facebook tie-in coming soon
Following the lead of nearly everything else on the internet, Oculus has announced it's adding social features to the company's VR platform. ...

Iran says missile tests not violation of nuclear deal: state TV
Iran said on Thursday that its test-firing of ballistic missiles, designed to be able to hit Israel, were not a violation of a landmark nuclear ...

Rory Feek To Pay Tribute To Wife Joey By Writing A Book
Rory Feek is still mourning the loss of his wife Joey, but that doesn’t mean that he won’t still be still living his life. Rory had a great marriage ...

Samsung Elec says preorders for Galaxy S7 phones stronger than expected
SEOUL (Reuters) - Tech giant Samsung Electronics Co Ltd has seen stronger-than-expected preorders for its new flagship Galaxy S7 smartphones ...

Now Bette Midler Challenges Kim Kardashian to Use Her Naked Selfie for Charity
ABC News Now Bette Midler Challenges Kim Kardashian to Use Her Naked Selfie for Charity People Magazine On Wednesday, three days after the ...

Apple working on a 5.8-inch iPhone with OLED display, rumor claims
If you thought Apple was done toying with the iPhone's form factor, you might be in for a little bit of a surprise. According to a report from ...

Nancy Reagan Begins Final Journey to Husband's Side
More than 3,000 people visited the casket of Nancy Reagan at the first day of a public viewing, and many more are expected on the second day ...

Attorney for Dr. Luke denies report of Sony Music split
Los Angeles Times Attorney for Dr. Luke denies report of Sony Music split Los Angeles Times An attorney for Dr. Luke has denied reports that ...

As seen in I, Robot: Goodyear unveils spherical tires for self-driving cars
What will the cars of the future be like? It’s fun to imagine how new technologies and design trends will influence future cars. Car bodies ...

Resources last updated: 3/9/2016 10:58:06 PM