Problem Extending DataGridColumn

C

Chris Arnold

Hi All,

OK, here's the situation ...

I have an ASPX page (.Net v1.1) that contains a DataGrid control. This
DataGrid is bound to a DataSource if not PostBack. Each row in the DataGrid
corresponds to 1 row in the first table in the Dataset bound to the
DataGrid. Pretty simple so far!

Now, I have extended DataGridColumn and created my own
DropDownListDataGridColumn class. I have overridden this class'
InitializeCell method so that it will interogate its Owner's DataSource in
order to populate itself.

This all works very well.

The problem is that the user can add extra items to any of the DropDownList
controls from client-side javascript. No matter what I try, I cannot 'find'
the SelectedItem of the control, once posted back, if it has been added on
the client side.

If I DataBind the DataGrid it only loads those items from the DataSource. If
I don't DataBind the DataGrid then it contains no items!!! All controls have
EnableViewState set to true.

Any help would be very much appreciated.

Chris
 
E

Elton Wang

Hi Chris,



Although you cannot retrieve any value added in client-side via javascript
code by using .NET web control method (it depends on ViewState), e.g.
ddl.SelectedValue, you can use Request.Form.Get(Control_ID) to get the
value.





HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top