473,406 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

DataGrid help.

CroCrew
564 Expert 512MB
Hello all,

First off I would like to thank anyone that helps me out with this problem that I have.

Ok, the environment I am working in is ASP.net with the code behind done in VB.

I have a DataGrid that gets populated dynamically from data within a MSSQL database. To keep this short lets just say that the DataGrid gets populated with five rows from the database. There is a “ButtonColumn” within the DataGrid that has the property “CommandName” set to “seed”. When the ButtonColumn is clicked a postback is fired.

Other items on the webpage is a “Lable” and a “Button”. The lable is used to display the item from the DataGrid that was selected. And the button is to be used for a “next” click sort of thing.

Here comes my question: after the postback is it possible to use JavaScript with the “Button” to programitically simulate the pressing of the next ButtonColumn from the one that was selected durring the postback?

Example: The “ButtonColumn” in row three was pressed and fired off the postback. The “Lable” is showing that row 3 was selected and if the user presses the “Button” then that button would triger another postback simulating as if the “ButtonColumn” in row four was pressed.

Many thanks for any help,
CroCrew~
Mar 17 '09 #1
2 1444
I take it you are looking for a "Next Item" functionality where you essentially select one row, then when you click on your special "next" button, the onclick event on the next row is executed?

This is easy to do in the codebehind. I suspect it difficult to do in javascript (client side) especially if you have paging enabled as you will have to do a postback to refresh the grid and bring up the next page.

You might try setting the focus to the next "button" which allows a simple click withought having to move the mouse. There is a discussion here on how to position to the "next control" much like using a tab key on a form.

HTH
Mar 17 '09 #2
CroCrew
564 Expert 512MB
Well, I need it to be client side (JavaScript) because after the post back there is a JavaScript function that runs and depending on some things done client side I need the JavaScript to fire a “next” record postback. No paging is done with this code.

Thanks for the feed back.

Anyone else have an answer?

Thanks,
CroCrew~
Mar 17 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Stephen | last post by:
I've got a datagrid with a remove button and I would like to add some code in the code behind page so as whenthe button is clicked the corresponding row in the datagrid is removed. The Datagrid is...
2
by: Chris Plowman | last post by:
Hi all, I was wondering if anyone can help me with a really annoying problem I have been having. I made a derived datagrid class that will select the row when a user clicks anywhere on a cell...
3
by: Ryan Liu | last post by:
Hi there, I got a NullReferenceException when delete last row in a datagrid. I had hard time to solve since it does not occur in my own code. I put a datagrid in my inherited user control,...
4
by: Glenn Owens | last post by:
I have a DataGrid web control which I've dynamically populated with template columns to be used for bulk-editting. Generally, all of the columns are textbox and/or dropdownlist child controls. ...
0
by: optimizeit | last post by:
What I am attempting to do is import an Excel Workbook and display the worksheets in a datagrid dynamically. I am very close to getting this to work. I have to this point successfully imported a...
5
by: Genojoe | last post by:
I am using code from Help with two exceptions. (1) I increased the number of sample rows from 3 to 20, and (2) I anchored the datagrid to bottom of form so that I can change the size of the grid by...
14
by: Brett Sinclair | last post by:
Hello everybody I'm still on the learning curve here...and from what I read, I created inherited datagrid class so I could have icons, combobox...etc in the columns of my datagrid. The grid...
4
by: Jeff User | last post by:
Hi I tryed to solve this problem over in the framework.asp group, but still am having trouble. Hope someone here can help. using .net 1.1, VS 2003 and C# I have an asp.DataGrid control with a...
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
10
by: amiga500 | last post by:
Hello, I have one basic simple question. When I have multiple records in the datagrid as follows: Code Product 1 Product 2 Product 3 11111 A B C...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.