|
Rank: Member Groups: Member
Joined: 12/2/2010 Posts: 10
|
I have a need to create a custom column in the grid control that contains either a text box or drop down list as its editor depending on an entry made in another cell. Further I need to be able to switch between them on the client without a postback. Is this possible with the grid control?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,200
|
Hi,
Yes. It is possible to do pretty anything with a CustomColumn because you would be doing everything yourself. For a CustomColumn, the Grid pretty much just give you an empty cell and the rest is all yours. In addition to give you an empty cell, the Grid also provide you the interface to get/save data to /from the Grid. So basically you take care of the UI and the Grid keeps the cell data for you. You can take a look of the CustomColumn documentation and samples to get an idea how this works.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 12/2/2010 Posts: 10
|
Hi,
Thank you for the quick response. I have reviewed the documentation for the custom column and the client JavaScript API. I believe I understand how to set the column up. The part I don't see how to do is reference the constituent controls that would be in my custom column. Would I need to generate ID attributes for the controls? I need to be able to do all of the following from JavaScript: set/retrieve values of the controls in my custom column, set which control is active (visible) and set the contents of the drop down list based on entries in other cells.
Forgive me if I've overlooked something obvious. My current project is the first one I've considered using the Essential Objects controls on. If you could provide an example or direct me to further documentation, I would appreciate any assistance you can provide.
Thank you.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,200
|
Hi,
You can use CustomColumn.EditorInstance.FindControl to find the server control inside your editor. Note that each column only keeps ONE instance of the Editor. It reuses the same Editor instance for all cells in that column.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 12/2/2010 Posts: 10
|
Okay. I took another look at the documentation and I think I've got it now. Thank you for your assistance.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,200
|
Great! Please feel free to let us know if you have any more questions.
|
|