Tech Off Thread

1 post

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

ASP.NET 2 - DataGrid - Multiple Select Buttons

Back to Forum: Tech Off
  • User profile image
    BugFree

    Hi all, I hope someone can help me on this. I don't know I'f I'm missing something obvious here but this has taken me far to much time already...

    The scnario is : I Have a datagrid on a web from. The datagrid has 4 columns, FirstName, MiddleName, Surname and Organisation. The DataKeyNames value for the grid is the ContactId. When I click on the select button I can get the Id for the contact by looking at "contactsGrid.SelectedDataKey.Value". I then have another datagrid that uses this value as a parameter value and populates some other contact data.

    Now, as well as having the select button to get the other data, I need another button on the row to do something else, in this case open a popup window with more contact details. I've added in a Commmand button and added code to the RowCommand event but I can't 'get' to the contactId for that row. I can't get the other contact details without the contactId!

    If the contactId was visible on the datagrid I could just refernce the cell it was in by getting the SelectedRow from the CommandArgument eventArg parameter, however this isn't acceptable as it would be visible on screen.

    Maybe I'm going about this all wrong, I wouldn't have thought it would have been this difficult to achieve.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.