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.
16 2213
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.
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.
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.
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.
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.
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
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.
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.
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
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.
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.
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
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.
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.
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.
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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,...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
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...
|
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...
|
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...
|
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...
|
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)...
|
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...
|
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
|
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...
|
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...
| |