Rank: Newbie Groups: Member
Joined: 3/25/2013 Posts: 1
|
Hi
I have grid with a custom column and a dropdown in the column. Just like the advanced sample. And like the sample clicking on the column makes the dropdown to appear.
However I would like the dropdown to be visible to the user when the grid is rendered, so that the user can see the dropdown and its default selected item without clicking on the grid column.
I tried setting enable to true and visible to true for the column and the dropdown.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
That won't work just with EditorTemplate. In the advanced sample, the drop down is inside the EditorTemplate. There is only one single EditorTemplate instance created for the whole column. So there is only one drop down. That drop down is then moved to any active cell when that cell enters edit mode.
However it is possible for you to create a drop down for every cell by handling the columns' ClientSideGetText client side event. You can return raw HTML from that handler that contains a select element. That select element will be placed as is inside the Grid cell. You will also want to attach some JavaScript event handler to that select element so that when user makes a selection, you would be able to update the cell value accordingly. Since HTML returned by ClientSideGetText is only displayed when the cell is NOT in edit mode, you may also need to handle ClientSideBeginEdit to return false so that it does not enter edit mode.
Thanks!
|