Rank: Member Groups: Member
Joined: 10/8/2007 Posts: 18
|
I would like be able to create a datagrid that starts with blank lines and when you click into the first cell, I need to display a listbox that is bound to a datasource. Is this possible? If so any example of this code would be greatly appreciated.
Thanks in advance!
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
|
Rank: Member Groups: Member
Joined: 10/8/2007 Posts: 18
|
I did follow the example, however, I wan to use asp.net listbox control and if possible, not javascript. Is this possible to use the custom column on the server side instead of client? I'm not very good at javascript and I need to be able to bind the templated controls to a datasource and then obtain the selected value to update my datasource. The example only uses javascript and no databinding. Please help! Thanks.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
You can use data binding on the server side to set the intial value, but you will also have to use JavaScript to display and edit it. In the sample code, the "value" is a number and it is passed to the grid through data binding (check Page_Load you will see it calls DataBind. In the sample the DataSource is an array of object, you would obvioulsy want to change it be your own data source, for example, a DataTable or DataSet).
Everything as to editing a CustomColumn must be done by JavaScript. JavaScript runs on the client side, that's why you can enter/exit edit mode without posting the whole page back to the server with our Grid. If that code were to run on the server, you would have seen what the standard ASP.NET DataGrid is doing -- click the Edit button, whole page goes back to the server and reload.
Thanks
|