I have created a custom list in sharepoint and then I created a dropdown col (as lookup) to use that list.
All I want items in the dropdownlist to be appeared in sort order. How can I do that.
Any suggestions! Thanks
View Complete Post
I have many controls on my form, but in particular, I have 2 dropdownlists. 1 dropdown list has 2 values, and each value controls what the second dropdownlist displays. This is an edititemtemplate and both dropdowns have the selecteditem set via '<%# Bind("fieldname") #>' on page load.
THe problem is, if I change the value of the first dropdown, it errors out because the second dropdwon has a bound value that is no longer acceptable.
Can I cancel the bind of the second control, if the the first one is changed? I would like to cancel the bind, and update the values by using a different datasource depending on the value of the first dropdown or hardcode the new values.
If Dropdown1 has a value of "A" for example Dropdown 2 Shows Values "1", "2", "3"
If Dropdown 1 has a value of "B" , Dropdown2 Shows Values "4", "5", "6".
It binds fine initially, but if I change Dropdown1 from A to B, I want Dropdown2 to show the new values, maybe with a default of "Select an Item" and not error out b/c it's attempts to bind a value of 1, 2, or 3.
Hope this makes sence, b/c I'm
I have a little problem with sorting a List<String>.
I have put 4 elements like this and now are trying sort them correct. My example below shows the problem. I am not sure of how sort the names so they comes in this order: "Folder1, Folder2, Folder10, Foler11" ?
List<String> GetNames = new List<String>();
GetNames.Sort(); //Sort the list
The sort comes in this order now which is wrong:
How to sort the list to have this order: ?
I have a dropdown list that has a bind on it and I get this error. Why am I getting this error and what can I do to fix it. here is the code for the dropdown I currently have:
<asp:DropDownList ID="DDLPreferred" AppendDataBoundItems="true" SelectedValue='<%# Bind("PREFERRED_COMMUNICATION") %>' runat="server" TabIndex="15">
<asp:ListItem Text="none" Value=""></asp:ListItem>
I have question about dropdownlist control.
I have a dromdownlist control which shows the list of dealers. I want toadd a sub-list to each dealer which should populate the products available atthat particular dealership. I don't want to select value from sub-list. Just want to display.
Inside a FormView control, I have a DropDownList that populates a SQL column with city names. The SQL column type is nchar(50) -- I set it for 50, since the city names can be short or very long. The DropDownList contains all the city names. When a new record is created in SQL via this FormView control, the DropDownList successfully populates the column cell.
However, when I try to edit that record (using the edit template in FormView), I get the above error message...I believe the retrieved entry is not matching the entry in the list, because SQL isn't just storing the number of characters that a given city has (say "6" for Boston), it is storing/retrieving 50 characters (6 + 44 null spaces = 50 characters)--and thus DropDownList doesn't recognize that the entry is just "Boston"...How can I resolve? How can I ensure that there are no extra spaces recorded in a SQL cell beyond what is needed to accomodate the name of any given city? Is this a SQL task or can it be resolved in ASP.NET? Thank you.
If you use a dropdownlist and the selected value for the ddl is not in the datasource. This can happen in an existing record if the user changes the datasource, e.g. deletes a row. ASP.net throws an exception.
To get around this problem, you can not bind the SelectedValue in the aspx page and use code like the following in the FormView_DataBound Event.
'-- Set DropDownList - Selected Value If Me.FormView1.CurrentMode = FormViewMode.Edit Then Dim ddl1 As DropDownList = Me.FormView1.FindControl("ddlTest") If Not IsDBNull(ddlTest) Then Dim strValue As String = (DataBinder.Eval(FormView1.DataItem, "DataFIeldName").ToString()) If ddl1.Items.IndexOf(ddl1.Items.FindByValue(strValue)) >= 0 Then ddl1.SelectedValue = DataBinder.Eval(FormView1.DataItem, "DataFieldName") Else dd
I have a dropdownlist in a detailsview edit Item template. Also I have two tables - Employee and Main. In the Employee table I have column EmpId and AssignedTo. In the main table I have EmpId which is connected to the Employee table.
The detailsView has a label which shows the AssignedTo name for a particular record and it works fine. But if I click the edit button to shwo the dropdownlist in the editItemTemplate it is givig me the above error.
The code is:
<asp:DetailsView ID="dtvAssign" runat="server" AutoGenerateRows
Hello all. I see that dropdownlist has an "items" property to get the list of displayed items for a dropdown, but it doesn't seem to have an equivalent property for getting the "values" associated with the items. For example, I may have a dropdown that displays "High", "Medium" and "Low", but returns values of "H", "M", "L". How can I easily get that list of HML?
Thanks for any help!
Sharepoint List in a Repeating table
I have a view with a Sharepoint List showing in a repeating table. I have conditional formatting to hide items that should not show based on Line Total.
Line Total = 4
Approver Min Amount Max Amount
Jim 3 9
Jack 1 7
Sally 2 5
Based on this, I need to sort the Approvers based on Max Amount and send an email to them in order of the sort. Is this possible?
Someone who can help me make a sort (asc / desc) in my ListView through a dropdownlist ?
Help! I've created text fields that have IP's but they do not get sorted right.
I know this is correct sort for normal text. Do anybody have any clue of how I can use IP's in Sharepoint 2007 lists?
How can we sort the parameter list in report created using report model in ssrs 2008 r2? Do I need to change some property in Model or elsewhere?