The SearchResultsGrid now has three data keys, CategoryId, CatalogNodeId, CatalogNodeTypeId.
The RelatedProductGrid has 4 keys, objectId1, objecctType1, objectId2, objectType2
When I add/remove a link, the objectId1 is the parent productId and the objectType1 is 1 since it's a product.
I need to map the CatalogNodeId to the objectId2 and the CatalogNodeTypeId to the objectType2.
I'm changing the following:
Code: Select all
protected void RelatedProductGrid_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int relatedProductId = (int)e.Keys[0];
SetLink(relatedProductId, false);
//CHECK THE SEARCH RESULTS GRID TO SEE IF THIS ITEMS APPEARS
int tempIndex = 0;
foreach (DataKey key in SearchResultsGrid.DataKeys)
{
int tempId = (int)key.Value;
if (relatedProductId == tempId)
Code: Select all
protected void RelatedObjectGrid_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int relatedObjectId = (int)e.Keys[2];
int relatedType = (int)e.Keys[3];
SetLink(relatedObjectId,relatedType, false);
//CHECK THE SEARCH RESULTS GRID TO SEE IF THIS ITEMS APPEARS
int tempIndex = 0;
int tempId = (int)SearchResultsGrid.DataKeys[1].Value;
int tempType = (byte)SearchResultsGrid.DataKeys[2].Value;
Can anyone tell me how to edit the above? I can change the order of the DataKeyNames="CategoryId,CatalogNodeId,CatalogNodeTypeId" to put the CatalogNodeId first and then that gets put into the database OK, but the type doesn't get put in.
Thanks