This is a migrated thread and some comments may be shown as answers.

unable to retrieve schema ensure that the connection string

3 Answers 107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
L
Top achievements
Rank 1
L asked on 26 Feb 2012, 12:11 PM
hi

I have this Stored Proc and my grid is empty and no error. I have tested the proc and is returning me the result but not the grid.

How should i go about it? Thanks

Create Proc test
as
DECLARE @query VARCHAR(4000)
DECLARE @years VARCHAR(2000)
SELECT  @years = STUFF((SELECT DISTINCT
      '],[' + ltrim(Dyear)
                        FROM    Product2
                        ORDER BY '],[' + ltrim(Dyear)
                        FOR XML PATH('')
      ), 1, 2, '') + ']'
      

SET @query =
'SELECT * FROM
(
 SELECT prodId,Dyear,amount
 FROM Product2
)t
PIVOT (SUM(amount) FOR Dyear
IN ('+@years+')) AS pvt'

EXECUTE (@query)

3 Answers, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 1
answered on 29 Feb 2012, 02:46 PM
L:

Have you referenced this forum thread yet? It provides access to a sample project from Telerik support that demonstrates the process for using a Stored Procedure as a data source for your RadGrid:

Connecting RadGrid to Stored Procedure

Hope this helps!
0
L
Top achievements
Rank 1
answered on 01 Mar 2012, 02:58 PM
hi

It is working fine now. But I have a column name CustID and i wish to hide it.

How do i hide it in code behind? Thanks
0
Accepted
Richard
Top achievements
Rank 1
answered on 01 Mar 2012, 11:47 PM
L:

You should be able to hide unwanted columns in the RadGrid_PreRender event in server-side code. Take a look at this forum thread which offers some sample code provided by Shinu:

how to hide columns in radgrid

Cheers!
Tags
Grid
Asked by
L
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
L
Top achievements
Rank 1
Richard
Top achievements
Rank 1
Share this question
or