• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 176
  • Last Modified:

Retreive values from row in Datagrid

I have one datagrid  and   textboxes namely student name, student Id and student add, student visit date.
\
Now   the user say enters either of the value in text boxes.............
based on that, i am  displaying the search in datagrid...
Now i want that when the user  selects any of the rows from datagrid , the values   will be displayed in the text boxes ( as i have mentioned  above)

 and  at the same  the search results remain in the  datagrid.. since this provides the user that he can select any other rows also......


Please  tell  me  in VB urgently
0
rajender123
Asked:
rajender123
  • 2
  • 2
1 Solution
 
abdulhameedsCommented:
display thecontent of datagrid values to text box
text1.text= datagrid1.columns(0).text
text2.text= datagrid1.columns(1).text

0
 
rajender123Author Commented:
Thanks  abdul...
but if th value is null in the datagrid it is showing the Type mismatch error...
how will i  get that value  that this is null/../..
how will i retreive that value..

please let me know
0
 
abdulhameedsCommented:
ok you can put on error resume next


private sub B1_click ()
on error resume next
text1.text= datagrid1.columns(0).text
text2.text= datagrid1.columns(1).text
end sub
so you can put the error resume on the top of sub
0
 
rajender123Author Commented:
Thanks my problem is solved now...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now