473,320 Members | 1,987 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,320 software developers and data experts.

Help on data-grid

aspamit
38
Hi all,
I am displaying data in data-grid using dataset.Now I want to select row of data-grid and fetch the values into it in text-boxes on the same page.

I mean I want to select the row i.e, by clicking it I can get the values into it.

Any help is appreciated.
Thank u.
Jan 27 '07 #1
16 2213
kenobewan
4,871 Expert 4TB
Here is an article that may help:
An Extensive Examination of the DataGrid Web Control
Jan 27 '07 #2
aspamit
38
Here is an article that may help:
An Extensive Examination of the DataGrid Web Control
thanks,
but I don't want to update or edit data in datagrid their only.Rather I want to select a particular row and on click event I want to get the values in that row.
And want to display these records in text-boxes outside of data-grid.

Pls help.
Jan 27 '07 #3
aaryan
82
thanks,
but I don't want to update or edit data in datagrid their only.Rather I want to select a particular row and on click event I want to get the values in that row.
And want to display these records in text-boxes outside of data-grid.

Pls help.
hi aspamit,
when you are defining the datagrid, set its itemcommand property also. for eg.
<asp:DataGrid id = ..... OnItemCommand = "grid_selectcommand"/>
while defining its columns,
<columns>
<asp:BoundColumn HeaderText = "Select" Buttontype= "Pushbutton" text = "select" commandname = "Select"/>
i hope till here you would have followed.
now in your code,
void grid_selectcommand(object sender,DataGridCommandEventArgs e)
{
Tablecell itemcell1 = e.item.cells[1]
Tablecell itemcell2 = e.item.cells[2]
and so on
here e.item is the row of the table where the command is raised.
for bound columns the value is stored in the text property of the tablecell.
so to retrieve the values in the textboxes outside the data grid, you can give text1.text = itemcell1.text
text2.text = itemcell2.text and so on (assuming you have declared textboxes in your web page.
hope this helps. any doubts or error pls feel free to post it again.
Jan 29 '07 #4
aspamit
38
hi aspamit,
when you are defining the datagrid, set its itemcommand property also. for eg.
<asp:DataGrid id = ..... OnItemCommand = "grid_selectcommand"/>
while defining its columns,
<columns>
<asp:BoundColumn HeaderText = "Select" Buttontype= "Pushbutton" text = "select" commandname = "Select"/>
i hope till here you would have followed.
now in your code,
void grid_selectcommand(object sender,DataGridCommandEventArgs e)
{
Tablecell itemcell1 = e.item.cells[1]
Tablecell itemcell2 = e.item.cells[2]
and so on
here e.item is the row of the table where the command is raised.
for bound columns the value is stored in the text property of the tablecell.
so to retrieve the values in the textboxes outside the data grid, you can give text1.text = itemcell1.text
text2.text = itemcell2.text and so on (assuming you have declared textboxes in your web page.
hope this helps. any doubts or error pls feel free to post it again.

Thanks for ur help Aaryan.
I don't want any button on my data-grid to display.
What u told is there is a button for each row in data-grid and the user should click that button to select that row.
Instead I want to raise onclick event in any part of the row.

Pls help.
Jan 29 '07 #5
aaryan
82
Thanks for ur help Aaryan.
I don't want any button on my data-grid to display.
What u told is there is a button for each row in data-grid and the user should click that button to select that row.
Instead I want to raise onclick event in any part of the row.

Pls help.
ok do you mean that if you click any part of the row say a particular column, only that column's value shd appear in the text box or the entire row. pls verify this for me and we shall proceed.
Jan 30 '07 #6
aspamit
38
ok do you mean that if you click any part of the row say a particular column, only that column's value shd appear in the text box or the entire row. pls verify this for me and we shall proceed.

Ya I should b able to click on any part of the row.And should b able to catch the values in that row in Text-boxes outside data-grid.

u r thinking on the same line?

Pls help.It's urgent.
Feb 1 '07 #7
aaryan
82
Ya I should b able to click on any part of the row.And should b able to catch the values in that row in Text-boxes outside data-grid.

u r thinking on the same line?

Pls help.It's urgent.
hi amit,
check if this site is of any use to you until i try to work some other way.
http://www.codeproject.com/aspnet/dgrowselect.asp
Feb 5 '07 #8
aspamit
38
hi amit,
check if this site is of any use to you until i try to work some other way.
http://www.codeproject.com/aspnet/dgrowselect.asp
Hi aaryan,
r u trying 2 solve my problem.
Feb 10 '07 #9
aaryan
82
Hi aaryan,
r u trying 2 solve my problem.
sorry amit,
i am yet to resolve it. i hope somebody else will help us too.
Feb 10 '07 #10
hi,
here is alink
http://aspalliance.com/136_DataGrid_and_Checkboxes
in this example the author has used the lablebox instead u can use a textbox
hope this helps u
with regards
Asha S
Feb 13 '07 #11
aspamit
38
hi,
here is alink
http://aspalliance.com/136_DataGrid_and_Checkboxes
in this example the author has used the lablebox instead u can use a textbox
hope this helps u
with regards
Asha S
Thanks for ur reply.But I am already through it.I used a button column instead.But I don't want to restrict user to click on that button for selecting row instead he should be to click on any part of the row on datagrid and accordingly select those values.
Feb 13 '07 #12
nb123
1
Thanks for ur reply.But I am already through it.I used a button column instead.But I don't want to restrict user to click on that button for selecting row instead he should be to click on any part of the row on datagrid and accordingly select those values.

Hi Amit!
I would be really grateful if u could give me the steps of how u went abt it. because i also need to do the same thing.
Please paste code snippets if possible.
Thanks.
Feb 15 '07 #13
aspamit
38
Hi Amit!
I would be really grateful if u could give me the steps of how u went abt it. because i also need to do the same thing.
Please paste code snippets if possible.
Thanks.
I will definitely help u.
But b patient
Feb 16 '07 #14
hi dear,
i tried to get this problems solution.i am working in asp.net 2.0.In asp2 this is not working properly...it is showing identifier error.if possible let me know the solution...
bye

hi aspamit,
when you are defining the datagrid, set its itemcommand property also. for eg.
<asp:DataGrid id = ..... OnItemCommand = "grid_selectcommand"/>
while defining its columns,
<columns>
<asp:BoundColumn HeaderText = "Select" Buttontype= "Pushbutton" text = "select" commandname = "Select"/>
i hope till here you would have followed.
now in your code,
void grid_selectcommand(object sender,DataGridCommandEventArgs e)
{
Tablecell itemcell1 = e.item.cells[1]
Tablecell itemcell2 = e.item.cells[2]
and so on
here e.item is the row of the table where the command is raised.
for bound columns the value is stored in the text property of the tablecell.
so to retrieve the values in the textboxes outside the data grid, you can give text1.text = itemcell1.text
text2.text = itemcell2.text and so on (assuming you have declared textboxes in your web page.
hope this helps. any doubts or error pls feel free to post it again.
Feb 19 '07 #15
aspamit
38
hi dear,
i tried to get this problems solution.i am working in asp.net 2.0.In asp2 this is not working properly...it is showing identifier error.if possible let me know the solution...
bye
What kind of error u r getting?
r u using GridView?
In Grid view it works properly.
Feb 22 '07 #16
aspamit
38
What kind of error u r getting?
r u using GridView?

Hi nb123,

I have some urgent work to do so I m late.

What r u doing and where r u getting errors?Let me know.I'wd like to help u.
Feb 22 '07 #17

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

Similar topics

9
by: netpurpose | last post by:
I need to extract data from this table to find the lowest prices of each product as of today. The product will be listed/grouped by the name only, discarding the product code - I use...
9
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with...
8
by: Lyn | last post by:
I am trying to get my head around the concept of default, special or empty values that appear in Access VBA, depending on data type. The Access Help is not much (help), and the manual that I have...
4
by: Tarique Jawed | last post by:
Alright I needed some help regarding a removal of a binary search tree. Yes its for a class, and yes I have tried working on it on my own, so no patronizing please. I have most of the code working,...
0
by: john | last post by:
Hi,All MS Tech Gurus: I need your help!!! It is the second time I post this message, I need get some feedback ASAP, Please Help!! Thanks a lot in advance. John I have a csharp method, using...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
2
by: Polyhedron_12 | last post by:
I am having problems calling functions in general in VB. I keep getting alot of errors. Can anybody help me out with this? I put the error message on the same line that it says it is at. I believe...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
31
by: Extremest | last post by:
I have a loop that is set to run as long as the arraylist is > 0. at the beginning of this loop I grab the first object and then remove it. I then go into another loop that checks to see if there...
53
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.