Welcome Guest Search | Active Topics | Sign In | Register

Custom Column with asp:ListBox control Options
sstoos
Posted: Wednesday, December 12, 2007 8:36:09 PM
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!

eo_support
Posted: Thursday, December 13, 2007 6:11:28 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Yes. This is possible. You can start with this sample:

http://www.essentialobjects.com/Demo/Default.aspx?path=Grid\_i1\_i15

Then set AllowNewItem to true as demonstrated with this sample:

http://www.essentialobjects.com/Demo/Default.aspx?path=Grid\_i1\_i7

Thanks
sstoos
Posted: Thursday, December 13, 2007 7:48:36 AM
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.
eo_support
Posted: Thursday, December 13, 2007 8:01:17 AM
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


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.