locked
How to select a row in a GridView and that the selected data is displayed in TextBox RRS feed

  • Question

  • User1782266108 posted

    Hello,

    I am working on a web form with vb.net in microsoft 2010, where I have a gridview that I fill with a method that shows me the SQL data and I want that when selecting a row the data of the row is shown in a textbox. I have seen examples but they are in C # and they have not been able to serve me since they do not have the same events.

    Saturday, January 5, 2019 1:10 AM

All replies

  • User475983607 posted

    Carolina.Salazar2038

    I have seen examples but they are in C # and they have not been able to serve me since they do not have the same events.

    Not true.  C# and VB.NET share the .NET is a framework.  I recommend learning C# syntax though.

    The GridView documentation covers the fundamentals.

    https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.gridview?view=netframework-4.7.2

    https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.gridview.rowediting?view=netframework-4.7.2

    VB.NET Example.

    https://www.aspsnippets.com/Articles/Edit-Update-and-Delete-in-ASPNet-GridView-with-AutoGenerateColumns-True-using-C-and-VBNet.aspx

    Saturday, January 5, 2019 2:08 PM
  • User1782266108 posted

    Thank you very much, I will read the links that I send ... the only problem with my update and delete is that the table I show is a composite table.

    Saturday, January 5, 2019 6:00 PM
  • User-1174608757 posted

    Hi Carolina.Salazar2038,

    Carolina.Salazar2038

    the only problem with my update and delete is that the table I show is a composite table.

    Could you please tell me the meaning of composite ? Is that when you click the edit Button then the construct of table changed?

    I hope you can post details about your code ,so it will help us to solve your problem quickly.

    Best Regards

    Wei Zhang 

    Monday, January 7, 2019 7:00 AM
  • User1782266108 posted
    I mean composed since the original table in the DB has pure IDs and I have a nested query where instead of showing the ID the description or name of the field to which that ID belongs is shown, whether courses, places, addresses , areas, posts, etc.
    Monday, January 7, 2019 4:09 PM
  • User475983607 posted

    I mean composed since the original table in the DB has pure IDs and I have a nested query where instead of showing the ID the description or name of the field to which that ID belongs is shown, whether courses, places, addresses , areas, posts, etc.

    It does not matter.  If you need the IDs in the UI then bind the IDs to hidden fields.

    Please take the time to read the linked documents to learn how to use the GridView.

    Monday, January 7, 2019 4:29 PM