__dopostback only does what I want after row 8

I want my datagrid rows to be clickable, so that a button column is
fired when my user clicks anywhere on a row. Using Google, I figured out
how to do it, but it only works after row 8. From row 9 on, the next
page opens properly, but clicking rows 1 through 8 does nothing - the
dopostback fires, but the page does not change. If I remove this code, 
the button column works fine. This sub seems to be disabling rows 1-8 
for some reason.

Here's my sub:

Protected Sub DataGrid_ItemCreated(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs)
e.Item.Attributes.Add("onclick",
"javascript:__doPostBack('dgrDataGrid$ctl" & _
(e.Item.ItemIndex + 2) & _
"$ctl00','')")	
end sub

I don't even know how to Google this problem. Can anyone tell me why 
this code should kill the functionality of my button column on the first 
few rows?

As always, thanks.
0
Arch
12/5/2009 2:44:44 PM
dotnet.framework.aspnet 1425 articles. 0 followers. Follow

1 Replies
815 Views

Similar Articles

[PageSpeed] 54

Figured it out. Life is good.


Arch wrote:
> I want my datagrid rows to be clickable, so that a button column is
> fired when my user clicks anywhere on a row. Using Google, I figured out
> how to do it, but it only works after row 8. From row 9 on, the next
> page opens properly, but clicking rows 1 through 8 does nothing - the
> dopostback fires, but the page does not change. If I remove this code, 
> the button column works fine. This sub seems to be disabling rows 1-8 
> for some reason.
> 
> Here's my sub:
> 
> Protected Sub DataGrid_ItemCreated(ByVal sender As Object, ByVal e As
> System.Web.UI.WebControls.DataGridItemEventArgs)
> e.Item.Attributes.Add("onclick",
> "javascript:__doPostBack('dgrDataGrid$ctl" & _
> (e.Item.ItemIndex + 2) & _
> "$ctl00','')")   
> end sub
> 
> I don't even know how to Google this problem. Can anyone tell me why 
> this code should kill the functionality of my button column on the first 
> few rows?
> 
> As always, thanks.
0
Arch
12/6/2009 5:50:52 PM
Reply:

Similar Artilces:

want questions
Hello Everyone, I want some set of questions on Word-2007 to check competency level of the user. Please help. -- Ananta Gupta Ananta, please refer to my other 2 postings: just check out the WORD part. If my comments have helped please hit Yes. Thanks. "Ananta Gupta" wrote: > Hello Everyone, > > I want some set of questions on Word-2007 to check competency level of the > user. Please help. > > -- > Ananta Gupta "trip_to_tokyo" wrote: > Ananta, please refer to my other 2 postings: just check out the WOR...

Selecting only odd numbered rows
I have a spreadsheet with data on all the even numbered rows. All th odd numbered rows are blank. The data is imported into the spreadshee from a text file. How can I select and delete all the odd numbered rows which have n data in them? (Manually doing this is not an option as there are 15 different spreadsheets with approximately 2500 rows of data on each -- Message posted from http://www.ExcelForum.com Can you do a sort or autofilter on the data ? That way all rows with data should be in the top half. Regards Bill K "Alan T >" <<Alan.T.12n317@excelforum-nospam.com>...

Getting the ROW of a COUNTIF result?
Hi For a cyclingclub i want to make a simple statistic of the members and how many 1st places, 2nd. plcases and so on, they have had during the season. I have a excel sheet with all races in a season. In the 1st. coloum i have the name and in the second coloum the final position in the race. Name Plc. xxxx xxxxxxxxx 3 yyyy yyyyyyyyy 1 zzzz zzzzzzzzzzz 5 yyyy yyyyyyyyy 1 The statistic i want to make: Name Pcl-> 1 2 3 4 5 6 xxxx xxxxxxxxx 0 0 1 0 0 0 yyyy yyyyyyyyy 2 0 0 0...

Find the last number in a row
Hi, I have lots of rows of data which are either a value between 50 and 200 (e.g 115) or "0". Each column is a specific week of the year, ie from 1/1998 to 52/2009, so the values run from left to right giving a number for each week, and when there is not an entry for that week, there is a "0". I need a formula to find the last number entry of each row. I could obviously do this by scrolling to the last week (52/2009) an looking back until I see the first number which isn't 0, however I need to do this for around 1600 rows of data. I would greatly...

Distribution List #8
I have a distribution list containing 40 e mail addresses. I want to install these addresses into the Address Book under One Heading. Then after I find out how to accomplish this move I want to send a message (the same message) to all 40 addresses at one time without revealing all 40 addresses to each recipient. Has anyone out there experienced this? File > New > Distribution List Place it in the BCC field when you send the message. -- Russ Valentine [MVP-Outlook] "David G" <anonymous@discussions.microsoft.com> wrote in message news:0e8901c3a20e$71ab27f0$a301280a...

I want more!
I need to extend a form that aleady has some 100 lines. For instance, one column has the date, but only until tomorroq. How do I create more lines based on the same formula? Thank you JB I usually select the last row in the range and copy it down a few rows. If you're using xl2003, you may want to look at Data|List. And if you're using xl2007, this feature has transformed into Tables. (Data tab on the ribbon|Data tools Group|What if Analysis|Data table) JB wrote: > > I need to extend a form that aleady has some 100 lines. For instance, one > column has the da...

Macro to delete row
Hi, i need a macro to delete rows that don't have in "H" column the name "John" If in "H" column the code finds anything else, then to delete row. Can this be done? Thanks! Hi, One approach might be: ================= Sub John() LR = [H65536].End(xlUp).Row For R = LR To 1 Step -1 If Cells(R, 8) <> "John" Then Cells(R, 8).EntireRow.Delete Next End Sub ======== Micky "puiuluipui" wrote: > Hi, i need a macro to delete rows that don't have in "H" column the name "John" > If ...

How to insert Rows
step by step I enter in all my project information for Job A including all the customers under that project So I begin Job B Later on I need to add a row so I can add another customer that is bidding Job A How do I do this? Is there any way to add them in the same row and still have my coinciding table work? From your description, you are working in either Word or Excel... If you were working in Access, you wouldn't need to worry about "inserting" rows between other rows, since tables only store data, while queries retrieve it. If you wish to be able to sort your dat...

entering a # each row adds 1 to the previous cell. Turn off?
When entering numbers in my spreadsheets each row adds another number. i.e., 2004 becomes 2005, then 2006. A telephone # becomes 811-6001, 6002, 6003. How do I turn that off so when I pull the corner down to copy it stays the same? You can right click and pull the corner and when you release the mouse you'll get an option of copy cells or hold down ctrl and pull down with left mouse -- Regards, Peo Sjoblom (No private emails please) "dbog" <dbog@discussions.microsoft.com> wrote in message news:C2C73C1B-4DC0-479F-BC57-8AF77E499991@microsoft.com... > When en...

Remote Users for GP 8.0
We have a remote site with 5 users that are connected to us via a T1 point to point at 1.5mbps. We would like to have these w/s connect to run great plains. Is a vpn possible? SHould we use a terminal server? Any advantages in using citrix? Thanks John John, I would usually recommend Terminal Server 2003 for what you're describing. VPN only (without TS or Cirtix) is not supported by MS, nor advisable, even over a point to point T1 you're not going to like the performance. Citrix doesn't really offer too many advantages over TS for 5 users, but is also a viable alter...

I don't want a page of the same label, I want one of each...
I can't find where to tell Pubisher that I want one of each label and not a page of each label. I'm using Publisher 2003 (Office 2003) I see a post that says to enter "<<Next Record>>" but Publisher doesn't see this as a field, just as text. This can't be that hard, but I can't figure it out... Any help would be appreciated. Kelvin I see that it prints correctly, but the print preview displayes it wrong.... I think I have it figured out... "Kelvin" <someone@domain.com> wrote in message news:OSpLwThUIHA.5508@TK2MSFTNGP04.phx....

Text want wrap in text box
I can't get the text to wrap in a text box, word wrap is set to true, I put some text boxes on a sheet today and the text will not wrap, I did this yesterday and it worked fine, I can copy the ones from yesterday and paste them on a new sheet and they work, any ideas? I have rebooted but this did not help. Using Excel 2000 (9.0.6926 SP3) Thanks Paul B If you're referring to a Control Toolbat text box make sure that the MultiLine property is True. -- Jim Rech Excel MVP "Paul B" <pbridgesnews@uga.edu> wrote in message news:%23ovLUkuLEHA.2456@TK2MSFTNGP12.phx.gbl......

Row Height Adjustment
The row heights did not automatically adjust to display all the text contained in the cell. I can manually go thru the rows and adjust them to display all the data; however, there are too many lines that need to be done manually. I have tried the 'auto' adjust feature, but it does not work. In fact, if I have manually adjusted some of the lines and use the 'auto' adjust, the lines I have changed will revert back to only display some of the info. Is there a limit of data that can be contained in a cell? Has anyone else had this problem? Hi do you have merged cells i...

Want to Add more Sub description Field
How I can add more sub description field like 1,2,3,4,5 regards Saleem Suri Salaam Saleem, You have only limit up to 3 fields in RMS 1,2,3 sub-description also you can use the extended description and there is main description for the item. so Altogether you have upto 5 description limit and I think that is enough. Let me know if this won't fulfill your requirements else use the Item Notes for more description. Rate if like Regards Akber "Saleem Suri" wrote: > How I can add more sub description field like 1,2,3,4,5 > > regards > Saleem Suri Salam Akbar ...

I want to add a sound event when the cursor bumps left margin
I want to know (via an event sound) that my cursor movement has bumped the left edge of the spreadsheet. I am entering thousand of rows of data, and it would help if there was a event sound when I returned the cursor to the left edge. I have this feature in 123, and find it helpfull. Put this in the sheet module: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Static ColOld As Integer If Target.Column = 1 And ColOld > 1 Then Beep ColOld = Target.Column End Sub -- Earl Kiosterud mvpearl omitthisword at verizon period net ------------------------------------------- "m...

Excel wants to create a page break in every cell!
After saving revisions in an Excel worksheet, I get a popup message that states "Margins do not fit page size". After clicking "ok" (because this is my only choice) a page break is automatically created in ever cell. At times(depending on the sizeof the work sheet) it can be over 100 pages with a page size 14% or smaller. Why does this happen, and how can I avoid it? I saw this suggestion in a different forum. Try closing excel. Clean up your windows temp folder Windows start button|Run type: %temp% and hit enter Clean all those files that you ca...

WANTED
WTB: I BUY SOFTWARE - CHECK AROUND - YOU PROBABLY HAVE SOME OF THE BELOW TO SELL TO ME. SEE A LIST OF SOME OF THE SOFTWARE THAT I AM BUYING! I AM BUYING ALL OF THE BELOW. THE MORE QUANTITY THE BETTER! I am looking to buy large quantities of Windows 7 Professional Upgrade Dell DVDs with unactivated COAs included in a SEALED package I am looking to buy quantities of SYMANTEC NORTON ANTI VIRUS, NORTON INTERNET SECURITY AND 360 OEM AND RETAIL BOXES I will buy 2010, 2009, 2008, 2007 and 2006. If you have good quantities setting around and no longer need send me detai...

select the number of rows using shortcut keys
Not able to select the number of rows using shortcut keys (SHIFT+DOWNARROW OR UPARROW) So what happens when you hit SHIFT + Downarrow? Should move down and select the next row as well as start row. SHIFT + END + Downarrow should select to next blank row. Gord Dibben Excel MVP On Wed, 10 Nov 2004 05:03:01 -0800, Naidu Samudrala <Naidu Samudrala@discussions.microsoft.com> wrote: >Not able to select the number of rows using shortcut keys (SHIFT+DOWNARROW OR >UPARROW) ...

Reference a specific cell in the active row
I am trying to write a code that will generate a comment box if the user enters a value not equal to the value I set. All my values are entered in column B. How do I need to word the code so that if the active cell is anywhere on row 4, the cell value is compared to B4, If the active cell is M27 then its value is compared to B27, etc. This is the portion of the code I am talking about. If Target <> WHAT DO I PUT HERE??? Then With Target .AddComment .Comment.Text Text:=Application.UserName & ":" & Chr(10) .Co...

Challenge with Time Formatting
Hi! Column A displays like this: 11:48:52. Column B displays AM. When I try to get column A to display with am or pm it converts the time to 12:00:00. I am not sure where the data is coming from, but it is being imported with this data as two seperate fields. Any suggestions?? Thanks! Hi normally a format like hh:mm:ss am should work -- Regards Frank Kabel Frankfurt, Germany Val B. wrote: > Hi! Column A displays like this: 11:48:52. Column B > displays AM. When I try to get column A to display with > am or pm it converts the time to 12:00:00. I am not sure > wher...

deleting full table gets "single row update/delete affected more than one row " error
I'm trying to run delete * from dbo_depend_table and i'm getting "single row update/delete affected more than one row" why? I can understand if I had a where clause, but I dont. system info: ms access 2000 ms sql server 2000 TIA tdr wrote: > I'm trying to run delete * from dbo_depend_table and i'm getting > "single row update/delete affected more than one row" why? > > I can understand if I had a where clause, but I dont. > > system info: > ms access 2000 > ms sql server 2000 > > TIA That usually indicates that your ...

I want to have a suggestion about dll
Hello! I have one IIS running four different asp.net C# applications using four different pools. This asp.net C# application is using a MFC dll called something with objectsXX.dll This objectXX.dll is also using another MFC dll called something with ExXX.dll We have a third dll created in vb called something vith vbXX.dll. The dependencies is the following asp.net C# application is using the objectsXX.dll and vbXX.dll This objectsXX.dll is using ExXX.dll. Today the vbXX.dll is registrered with four different names such as vbXX_1.dll, vbXX_2.dll, vbXX_3.dll and vbXX_4.dll But we have on...

Want to avoid the possibilty to edit field in listbox
I fill my listbox with code example found on the internet written by Zameer Abdulla, LVLoadData.mdb. I'm not good at programming, only good at copying code :-). When I click twice on the same row in the listbox it becomes possible to edit the first column field. How can I avoid this. Appreciate any tips. Code below: Public Sub FillEmployees() On Error GoTo ErrorHandler 'set variables Dim rs As DAO.Recordset Dim db As Database Dim lstItem As ListItem Dim strSQL As String Set db = CurrentDb() strSQL = "SELECT * FROM Employees w...

Want to link a cell of numbers with a cell of text & can sort
I have a column of #s and a column of text. The column of text describes the column of numbers. I don't want to have to retype either column. Is it possible to LINK/CONNECT the two columns so that they will act as one unitl? If I try to merge the cells in the same row of the two different columns I lose the text. This is important because I must monthly import data and the data in the columns could either increase or decrease. Please advise. Thank YOul hi you might consider a formula. =A2&B2 if you need a space between the numbers and text.... =A2&&qu...

i need help with error on deleting rows in vba #2
Thanks Dave you hit the nail on the head. some of the rows below g25 were neve touched. your code fixed it. thanks -- GregJ ----------------------------------------------------------------------- GregJG's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1106 View this thread: http://www.excelforum.com/showthread.php?threadid=26123 ...