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

Use ArrayList and Stored Procedure Output To Populate Different Columns In Same RadGrid

1 Answer 96 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jgill
Top achievements
Rank 1
jgill asked on 26 Jan 2009, 04:52 PM

This may be a beginner’s issue, but I am having trouble with a situation that I need help with.  One set of data that is stored in an ArrayList and another that is stored in the DB (results from a stored procedure).

 

I need to have a RadGrid with two columns (right now the RadGrid is on the .aspx page, but the datasource is binded in the code-behind).  The first column’s cell’s will all have different values, but the second column should have a dropdown list populated with the same data in each cell (e.g. product list).  Essentially the data in column 1 will not be editable, but the value in each cell/drop down for column 2 needs to be selectable.  The data is column 1 is not stored in the DB (it is from an ArrayList that is built from reading data from a file the user just uploaded), while the data that would be in the drop downs in column 2 is from the results of a stored procedure in the DB.  It is a mapping exercise where the user must match an item from the array list to an item from the drop down list then save the changes for each row or the RadGrid as a whole.

 

ArrayList Column          DropDownListColumn (Each row should have a dropdown list with the same choices, populated from the same stored procedure call)

ArrayListString(i)          DropDownList

 

 

Does something like a datatable/dataset need to be built programatically in the background?  Could you please show me how to do this?

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 29 Jan 2009, 09:32 AM
Hi jgill,

In this case, you have two types of data. The first is the data which resides in the database, and is pulled from there via the Stored Procedure. The other data is the static data. Hence, you can use the NeedDataSource event handler, and create a custom DataTable, which includes both types of data. This DataTable can be passed as a datasource for the grid.
I hope this suggestion helps.

All the best,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
jgill
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or