2 gridviews on one row, problem with render for double click function on a grdiview row


I have an application with 2 gridviews on one page. On the first gridview (GridViewRequests) I have a function to double click on a row, when I double click a detail screen opens where I can edit the data of the selected row. Now I want the samen function on my second gridview (GridView1). I was thinking this should go easy because I can simply copy the code from the first function en change the names to my second gridview. But I have a piece of code which I can't duplicate. Can I solve this in another way?? It's this code:

Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
' The client scripts for GridView1 were created in GridView1_RowDataBound
For Each r As GridViewRow In GridViewRequests.Rows
If (r.RowType = DataControlRowType.DataRow) Then
Dim cellIndex As Integer = 2
Do While (cellIndex < r.Cells.Count)
Page.ClientScript.RegisterForEventValidation((r.UniqueID +
"$ctl00"), cellIndex.ToString)
Page.ClientScript.RegisterForEventValidation((r.UniqueID +
"$ctl01"), cellIndex.ToString)
cellIndex = (cellIndex + 1)
End If


End Sub


 Please give VB.NET code because I don't know C#.

Many thx in advance!!!

4/21/2008 11:01:58 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 58

Hi pimps,

I am not sure what relation between two gridviews. Is it nested gridview? Please describe in details and paste more codes for us.


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.
4/23/2008 7:53:38 AM

thx for the repsonse, but I solved the problem with another javascript double click function and it's working very well now.
If somebody needs the code, just send a personal message and I'll post it.

Many thx!

4/28/2008 10:14:47 AM

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 ...

Gridview row click event fires, when clicking on controls within row.
I have a gridview control and I have added  a row click event which causes a post back. e.Row.Attributes.Add("onClick", this.Page.ClientScript.GetPostBackEventReference(this, "Select$" + e.Row.RowIndex.ToString()));  When the user clicks the row, i bind some data to a checkbox list, showing a uers a list of options they have chosen. All good so far. I also have a edit button for each row. When the row is in edit mode i display a checkbox and textbox. Problem is when i click on the textbox or the checkbox, it causes the row click event to fire. Any ida...

Adding row (one at a time) in gridview on a button click. And cells of added row should contain controls like DROPDOWN LIST or TEXT BOX.
Dear Friends, I am in great need for the solution/hints/guidance of my requirement, if anyone can help with.  Let me explain what I need."I need a Gridview control on a webpage having following 5 columns/fields.     Column 1: It just has a "+" button in its header only (other cells for this column is empty)    Column 2: The Column header here is "FIELD" and  it should contain dropdown list (which is populated from some database)    Column 3: The Column header here is "Operator" and  it should ...

Displaying 2 rows as one row in GridView--very urgent
Hi I need to display 2 rows as a one row in Gridview like this in text boxes and also I need horizontal paging on the gridview... any help would be much appreciated !!! ---------------------------------------------------------<<  Jan| Feb| Mar| Apr| May| Jun| Jul|   >>---------------------------------------------------------  A  10 |  20 |  30 |  40 |  50 |  60 |  70 |  B  10 |  20 |  30 |  40 |  50 |  60 |  70 |&...

Gridview row-by-row rendering
Hello guys,I have a bit of a dilemma. I have a Gridview control and I want it to be rendered row-by-row on the page.I tried to do it this way:protected void myGv_RowDataBound(object sender, GridViewRowEventArgs e) { StringBuilder renderedOutput = new StringBuilder(); StringWriter strWriter = new StringWriter(renderedOutput); HtmlTextWriter tWriter = new HtmlTextWriter(strWriter); e.Row.RenderControl(tWriter); Response.Write(renderedOutput.ToString()); Response.Flush(); }But this is totally wrong because IE doesn't render a table until the end tag is provided. Do you have an...

Error with Gridview when i delete the row that have only one row in gridview
 Dear all, i develop with asp.net 2005 and use gridview and set enable deleteing =true. I can delete record in gridview properly but when gridveiw has only one row and then i'm clike delete button , the error occurs :   Server Error in '/it' Application. Specified argument was out of the range of valid values.Parameter name: value Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentOutOfRangeExce...

How to double click one row in Gridview then Edit command
How to double click one row in Gridview then Edit command or in DNN 4.3 I double click 1 record when view then can edit record ?? help me . using ajax or ??? Hi, codingvn: This great article may help you http://aspalliance.com/946Best Regards,__________________________________________________Sincerely,Rex LinMicrosoft Online Community SupportThis posting is provided "AS IS" with on warranties, and confers no rights....

Easiest way to click on a GridView row and fill a page with ALL the fields on that row(even the hidden ones)
 Hi everyone!My question is pretty much what the subject says.I have a GridView that shows data from a database using LinqDataSource.Im trying to make a website where the GridView is shown, and when someone clicks on a row it opens a page where ALL the data of that row is presented nicely. <link>http://petitions.number10.gov.uk/list/open?sort=deadline</link> The thing is some columns are hidden so I cant access them, at least not the way I do it.So I would like to know what the easy way to do this is? Im sure its a very common procedure.Thank you.Paul You can make an...

How to get two gridviews in one cell of a row in .net 2.0
Hi I am trying to display two gridviews in a row using datalist.  This is how my code looks <asp:DataList ID="DataList1" runat="server" RepeatDirection="Horizontal" DataKeyField= "GroupID" RepeatColumns="2" OnItemDataBound="DataList1_ItemDataBound">                              <ItemTemplate>              &nb...

Row clickable functionality for gridview using AJAX.Net beta 2
Hi All, We need to implement clickable row editing functionality for GridView control. User should be able to click anywhere in row and GridView should be available in edit mode. GridView provides built-in functionality to edit grid via using Edit command button. We are using AJAX.NET beta 2 to avoid entire page post back. To provide row clickable functionality we implemented IPostBackEventHandler interface. We are registering these controls in Row data bound event. Now clicking on any row causes entire page post back, while we want it to be partial post back using AJAX...

How to find a outer gridview row when a button in inner gridview row is clicked
Hi, I have a gridview within a gridview. In the inner gridview, I have a column of imagebuttons. I cannot figure out how to find out the row of the outer gridview when I click on the imagebutton in the inner gridview. I modifies the code below to get rid of some of the unnecessary stuff. <asp:GridView ID="SitePrepMainGV" runat="server" DataKeyNames="SitePrepItemID" DataSourceID="SitePrepMasterDS" OnRowDataBound="SitePrepMainGV_RowDataBound" OnRowEditing="SitePrepMainGV_RowEditing" OnRowCreated="SitePrepMainGV_RowCreated"> <Columns> <asp:BoundField DataField="S...

Help! Find row on which a button was pressed in the gridview control in .NET 2.0
How do you get the exact row (and column data from that row)  on which a button was pressed within a gridview. In .NET v1 using the datagrid control the followingconstruction was available:objArgs.Item.Cells(n).Textusing the datagrid DataGridCommandEventArgs parameter. choices in gridview are     Sub cmdBackTestSummary(ByVal objSender As Object, ByVal objArgs As GridViewCommandEventArgs) ' objArgs.commandname ' objargs.commandarguement ' objargs.commandsource     End Sub but no objArgs.Item.Cells(n) So how do you get the exact row (and c...

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...

Find the row number on click of a gridview row???
Hello everyone,I need to find the gridview row number on click of a row on Page_load not on any other event..!! How do i do that?Please help me..!!regards,Francis P. Ferns Sorry Francis, but I believe you're out of luck as the Page.Load event is way too early in the Page lifecyle to pick this up. This would most likely be done in the SelectedIndexChanged, RowCommand, or Click event of a Button.Thanks, EdMicrosoft MVP - ASP/ASP.NET Hi,Ya i understand that. Is there any other way i can find out the Row number.I ll tell you my actual requirement.Im implementing the ICallbackEventHa...

Web resources about - 2 gridviews on one row, problem with render for double click function on a grdiview row - 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: 12/21/2015 8:51:53 AM