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

[Solved] GridDropDownColumn

2 Answers 126 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Christopher Borys
Top achievements
Rank 1
Christopher Borys asked on 17 Nov 2009, 09:55 PM
The GridDropDownColumn is one of the most often used and yet I struggle (and many other as seen in the counless forum questions) with the fundamentls probably due to very weak documenatation and description of strategies and common approaches.

If the grid represents a data table tbl_A, then most likely the GridDropDownColumn will represent a value tbl_A_value that is taken from another list lets say tbl_B (tbl_B_value, tbl_B_description).  In the view mode, we want the grid to find description corresponding to tbl_A_value from tbl_B.  In the edit mode, we would want all the choices from tbl_B to appear in the drop down box.

I represent tbl_A and tbl_B through datasets and datatables.  Since, the tbl_B is virtually static and is the same for all the items in the collumn, I feel that there should be one place to initialize the internal GridDropDownColumn.  I really don't think that the ItemDataBound()  is the right place to do so.  I tried several approaches but none of them worked:

1) Defined  GridDropDownListColumnEditor in aspx and in PageLoad() defined its DataSource by assigning the appropriate DataTable.
2) Also in PageLoad(), I casted  grid column from MasterView to GridDropDownColumn and tried to assign appropriete values but don't know how to assign DataSource since only DataSourceID (string) is available to be set.

I guess I would like someone to post example on how to do GridDropDownColumn most efficiently using DataSet or DataTable solutions and no embedded SQL statements.

Chris

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 18 Nov 2009, 09:51 AM
Hi Chris,

Here's a help document that you can refer to, so as to customize your GridDropDownColumn. Take a look at it and check if it helps:

Hope this helps,
Shinu.
0
Christopher Borys
Top achievements
Rank 1
answered on 18 Nov 2009, 03:35 PM
No that document does not help and the method discussed in that document misses the point. 

1) I am looking for simple, general method to work with GridDropDownColumn and dataset
2) If I need all that work as in the document you suggest then I don't know what is the definition for DropDownColumn there?
    I can do all that using templates.  By defining a specific type of column I expect some work to be done by its nature and internal
   functionality.

Telerik team seems to be silent on issues like that but really these are the issues that turn me off from the product. 
The documentation is weak and the examples too trivial so any development time I gained eventually I loose by chasing stupid issues.

Chris
Tags
Grid
Asked by
Christopher Borys
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Christopher Borys
Top achievements
Rank 1
Share this question
or