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

[Solved] Problem in loading grid with IList

1 Answer 108 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jidesh Guptha
Top achievements
Rank 1
Jidesh Guptha asked on 30 Jul 2009, 11:51 AM
Hi,

Am trying to work with nHibernate and execute a query get the return value of the query output as IList Collection.

if i try to retrieve all the column value by using the "From" and populate the IList collection and assign that object to the data source of the radGrid its working fine.

If i try to retrieve specific columns using the  "Select" and populate the IList Collection and assign the same object to the data source of the radGrid its not working properly
private Void FormatQuery(string sTableName)  
            {  
                string FormatedQuery = "";  
                FormatedQuery = "from " + sTableName.ToUpper().ToString() + "Entity A";  
                //FormatedQuery = "Select a.FIRST_NAME,a.COMMENTS  from " + sTableName.ToUpper().ToString() + "Entity a";  
                  
                IList data;  
                CommonDataAccess CommonData = new CommonDataAccess();  
                data = GetData(FormatedQuery);  
                Simple_Grid.DataSource = data;  
 
            }  
 
      public IList GetData(string sSQL)  
        {  
            ISession sDataSession = NHibernateHelper.GetCurrentSession();  
            IList oDataObj = sDataSession.CreateQuery(sSQL).List();  
            return oDataObj;  
        }  

In the above Code. if i try to get the value by passing the Query in the "FormatedQuery" variable its working fine
The same is not working fine if i use the query in the Commented Line.

Pls guide me how to proceed.

Jidesh

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 31 Jul 2009, 05:56 AM
Hi Jidesh,

Can verify using the debug if you have any items in this IList? If there are items can you post item properties? I suggest you also to check how MS GridView will behave in this case.

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Jidesh Guptha
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or