.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

searching a list box

Posted By:      Posted Date: August 30, 2010    Points: 0   Category :ASP.Net
Hi All, I am trying to search a list box by adding a text box next to it. in the textbox_textchanged I added below code 'Retrieve the item's listindex Dim i As Integer = List1.FindString(Text1.Text) 'highligting the matched ones List1.SelectedIndex = i   But I am getting Below error Error 1 'FindString' is not a member of 'System.Web.UI.WebControls.ListBox'  How can I resolve this?

View Complete Post

More Related Resource Links

searching the list box

In a button click I will make apanel visible inside that Panel I have textbox, listbox with data(Data already populated from the stored procedure)  Now What I am trying to do is If i type some thing in the text box like 'kris' all the items that matches 'kris' should get selected in the list box. Please see my code below Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged        Dim dr As SqlDataReader        dr = SearchUsers(TextBox1.Text)    End Sub   right now dr is bringing all the matched rows and I am not sure how can I make the listbox to select all the retrieved rows .aspx <asp:listbox id="ListUsers" runat="server" DataValueField="UserID" DataTextField="Name" SelectionMode="Multiple"></asp:listbox><BR> //The SP is also retrieving userid and Name.

Searching list<> in C#

I have a class class ClassName { private int id; private string name; }    in my application i created a list of ClassName elements List<ClassName> items=new List<ClassName>(); I populated this list with ClassName elements.. In some place i want to delete all the list elements with matching search string. for example... this list contains four item ..like   id=1,name="Hello world" id=2,name="Hi world" id=3,name="world" id=4,name="good"   i want to search this List with string "world" and delete all the elements in the list which contains this string. which means only fourth element should remain in the list. Help me how to do it.  

Searching a list of objects using 'and' and 'or'


I would like to allow the user to be able to perform searches on a large list of objects.  They will be able to search for keywords and use 'and' and 'or' operators.  I am having trouble finding the best way to implement those operators in my LINQ query.  Any suggestions would be appreciated.

Searching sharepoint list records?


searching sharepoint list items  like wild card searches as well in the site

Thanks & Regards, sruthi

User Information List and Searching



On the Userdisp.aspx I have some code to redirect to a custom profile page. My issues is that when searching for a user that exists in the User Information List the search does not pick up that user.

I have checked that the list is searchable and the required permissions are in place.

So the question is does Wss3 search actually search that list? If so then what else could be stopping it picking up those users.



Moss Simple Search not searching new items in list until keyword is "propertyName:Keyword" i.e Custo



Problem : Simple search not showing the new items created in list. It shows the new items if searched with keyword as  "propertyName:Keyword" i.e CustomeName:John

There is a metadata property "CustomerName", which is mapped to a custom column(Customer Name) in a sharepoint list as ows_CustomerName(Text). Also there is a scope(Customers) created which has folder set to URL of the sharepoint site containing this list.

The items are indexed for sure as they are searchable if simple search keyword is  "propertyName:Keyword" i.e CustomeName:"John Smith" . But not searchable if the keyword is John Smith

Is there anything missing??

Ready made List Types provided by SharePoint

SharePoint provides some out of the box List Types. Some of the most used ready made list types that SharePoint provides currently are listed below:

Export SharePoint List to Excel Spreadsheet Programmatically using C#

In SharePoint applications, Custom Lists are used to store business data and Document Libraries to store the documents. But for data manupulation and analysis, Microsoft Excel provides very rich features as compared to SharePoint Lists. That's why people still loves to work on Microsoft Excel Sheets.

Dropdown list in ASP.NET - How to get value selected

am sure this must be very simple, but unforunately I can't figure it out.
I have the following code which populates the dropdown lists from the database. This works fine. Now, when the user selects a particular employee name from the list, I want to get the Employee Id of the selected employee. i.e. I need to get the "Eid" value. I can do this if the EId is loaded in the dropdown list, but in this case only the employee name is displayed. Please let me know howI can get the Eid value even though it is not loaded in the dropdown list.
I would really appreciate your help

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

Editable Gridview with Textbox, CheckBox, Radio Button and DropDown List

This is an example of an editable gridview containing different ASP.NET controls. When user wants to edit values in gridview, she/he can use these controls to edit existing values in Gridview Edit Mode.

Using the Code

Get pixel format, raw format, property id list and property items image in VB.net - C#.net.

n this simple article you will learn that how we can get pixel format, raw format, property id list and property items image in VB and C#.net.

Get Pixel Format:

Image consists of pixels to get the format of the pixel we have a property named pixel format. This property returns an enumeration of pixel format. This enumeration tells the pixel format.

To demonstrate make a window application. Drag one button and a picture box on form.

Now write the following code on Button click event:

Binding an array to dropdown list


I have the following string which is a list of urls. How do I get this to work so the url shows for the selection and also is the value?      


allLinks = newAllLinks
        Me.DropDownList1.DataTextField = "Link"
        Me.DropDownList1.DataValueField = "LinkURL"
        Me.DropDownList1.Items.Insert(0, New ListItem(" - Select - ", 0))
        Me.DropDownList1.DataSource = allLinks


 ArgumentNullException: Value cannot be null.
Parameter name: container]
   System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +121
   System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName, String format) +8

Compare List


i have got two list<string> containing datas

i would like to compare the both list and the result to new list whch does not contains the same data.(basically unique data)

eg shown below..

list A       list b          list c

a             a                 d

b           d                    c

c            f                   e

f            e

plz let me knw..

asp.net searching


i am developing an application in asp.net in which i can implement word stemming search could any one help me doing this ...i am very new to asp.net and required help from scrach.

Gridview with a dropdown list for editing


Hello. I am working through Scott Mitchell's ASP.Net in 24 hours book. I am finishing the photo album project.

I have a GridView that retrieves a list of uploaded photo rows for the logged-in user.
The GridView is for editing and deleting rows.

The photo Category field in the Gridview is a dropdown list. The text entry field was deleted after converting this field to a Template.

Like the uploaded photos, these Categories are user-specific. They are created in another web page.

Users also have the option to select "none" for the category when they upload an image.

For the GridView:  The Category ID field's ItemTemplate and EditItemTemplate both have a " - None - " choice added to them.

I am getting this error:

'pictureReadOnlyCategories' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value


Note: The ID for the ItemTemplate for that dropdown list is the ID listed above in the error: "pictureReadOnlyCategories".


Am I missing some step in this process of changing a GridViews text field to a dropdown that can be used for editing? I went through the book's instructions three times.

Here is my code for the dropdown list and a screenshot of the Design

Gridview Edit on Searching of Record


using Asp.net c#

sql server

i am searching a record from my database and displaying it in gridview now i want the comments should be updated as per the record which is being searched

For E.g if record No.3 is searched then only i can update record no.3 and i don't want rest of data to be shown

now what is happening when i click on edit my whole table is being displayed

this is bcuz i made one method gridfill() which i m calling everytime if i m doing grid row editing,row cancelling and row updating

how i can resolve this thing

my code

 protected void GridView2_RowEditing(object sender, GridViewEditEventArgs e)
        GridView2.EditIndex = e.NewEditIndex;


 protected void GridView2_RowUpdating(object sender, GridViewUpdateEventArgs e)
        string id = GridView2.Rows[e.RowIndex].Cells[0].Text;
        TextBox t;
        t = (TextBox)GridView2.Rows[e.RowIndex].Cells[2].Controls[0];
        string query = "update user1 set comments=@comments where id=@id";
        SqlConnection con = new SqlConnection(connstr);
        SqlCommand cmd = new SqlCommand(query, con);
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend