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

Override RadGrid Headers for a data import process...

1 Answer 41 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Wired_Nerve
Top achievements
Rank 2
Wired_Nerve asked on 18 Oct 2013, 01:45 PM
It seems to me the user story below would have been done before many times by others so I am just trying to see if anyone knows of an example or such before I start down this road.. so I can save time...


User Story
1. A user will be uploading an excel workbook to our server.
2. We will then bind this workbooks data to a radgrid (number of columns will vary)
3.The user will then need to map each column in the radgrid to a set of corresponding data columns in our database.
4. Once the user has selected a mapping for each column (it is possible to ignore some) they will submit to our system for validation and import.

Now in step 3 I will need to provide a means to provide a combo dropdown in the header row that contains all of the database mappings for this import process... 
For example they could be (Ignore, First Name, Middle Name, Last Name, Cell Phone, Address 1, Address 2, City, State, Zip, Custom 1, Custom 2 and etc...) then the user would map each column in the radgrid to a column

Has anyone done something similar that they can point me to so I can read about it.. I just don't want to reinvent the wheel.....

NOTE:  It would be nice to include the header row in the excel workbook (if provided - user will select top row is a header row) in the radgrid with the dropdown also...

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 23 Oct 2013, 09:01 AM
Hello Warren,

This is definitely not a common scenario. It is rather a custom one or at least I can't think of anyone asking for the same thing before. Nevertheless, I believe a possible way to implement this functionality would be to create your RadGrid programmatically on Page_Init as explained in the Programmatic Creation help topic. You can place the mapping combo control in a (programmatic) header template (explained in the above topic under the Creating Template Columns Programmatically section) and then bind it on RadGrid's Item Created event for example.
I hope this helps.

Regards,
Daniel
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Wired_Nerve
Top achievements
Rank 2
Answers by
Daniel
Telerik team
Share this question
or