Page 1 of 1

Grid Values won't delete if populated by Stored Procedure

Posted: Thu Oct 15, 2009 10:01 am
by cskantzaris
I have a user defined grid that populates using a stored procedure.
I pass a couple of different field values to the SP, and have it populate the grid.
I then clear the fields.
When I try to delete any of the lines in the grid and save, all the previous grid lines return.
THis only happens with the grid lines populated by the SP. If I manually add a grid line, and then delete it, it won't return.
Anyone run into this before? Any ideas how I can fix this?
THanks

Re: Grid Values won't delete if populated by Stored Procedure

Posted: Wed Oct 30, 2013 10:56 am
by jon_davis
Did you ever resolve this issue? I have an identical problem. Ironically, I have other custom grids on the same InfoCenter (Project) for which I also insert rows using a stored procedure and these grids do not have the issue.

Re: Grid Values won't delete if populated by Stored Procedure

Posted: Sat Nov 09, 2013 2:05 am
by Emma Howard
If you are populating by stored procedure, is your stored procedure not re-running and re-populating the fields. Also try this stored procedure to clear



/****** Object: StoredProcedure [dbo].[_ClearCustom_sp] Script Date: 08/09/2011 14:15:22 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[_ClearCustom_sp]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[_ClearCustom_sp]
GO



/****** Object: StoredProcedure [dbo].[_ClearCustom_sp] Script Date: 08/09/2011 14:15:22 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO




Create proc [dbo].[_ClearCustom_sp]
@ref VARCHAR (255)
, @table varchar (255)
, @info varchar (20)


as

begin



declare @cmd varchar (8000)


select @cmd = 'delete ' + @table + ' where ' + @info +' = ' + ''''+ @ref +''''

--select @cmd
exec (@cmd)




end
GO