views:

206

answers:

0

The title may be a little unclear, I wasn't sure how exactly to describe the problem.

I have a gridview displaying a list of notes on particular customers. It uses a linqdatasource to retrive the notes to display from an SQL database. One of the columns in the gridview is an 'Assign To' column, where you can select a user to assign that particular note to.

I have created an edit template for the assign to column, that displays a list of valid users to assign customer notes to.

Everything is hooked up and working fine, it displays the list just fine. Editing also works fine, so long as you want to select one of the users in the list.

The problem is that I want to add a 'null' value to the assign to row - in that if the 'assignto' column is null, it means that noone needs to follow up on that particular note.

My edititemtemplate for the dropdown looks like this:

 <asp:DropDownList ID="AssignToDropDown" DataSourceID="UsersToAssignToDs"
      DataValueField="Userid"  DataTextField="Username"
      SelectedValue='<%#Bind("RequireFollowupBy")%>' runat="server">                                
 </asp:DropDownList>

UsersToAssignToDs is a linqdatasource that has the list of people you can assign notes to.

I know I can add an extra element to the dropdown by manually entering one and setting 'AppendDataBoundItems' to true, but that doesn't seem to work as the appended item isn't in the UsersToAssignToDs, so it wont let me update the row if the manually entered row.

How can I make the dropdown list a little more flexible? Is there some way to make the manually appended list item reinstertable? Or do I have to someone add it to the datasource in the first place?