Click here to Skip to main content
15,867,977 members
Home / Discussions / WPF
   

WPF

 
JokeRe: Routing ComboBox SelectionChanged Pin
Jammer15-Jul-08 9:50
Jammer15-Jul-08 9:50 
GeneralRe: Routing ComboBox SelectionChanged Pin
Pete O'Hanlon15-Jul-08 9:53
subeditorPete O'Hanlon15-Jul-08 9:53 
GeneralRe: Routing ComboBox SelectionChanged Pin
Jammer15-Jul-08 10:00
Jammer15-Jul-08 10:00 
GeneralRe: Routing ComboBox SelectionChanged Pin
Pete O'Hanlon15-Jul-08 10:06
subeditorPete O'Hanlon15-Jul-08 10:06 
GeneralRe: Routing ComboBox SelectionChanged Pin
Jammer15-Jul-08 10:12
Jammer15-Jul-08 10:12 
QuestionHow to bind Listview to Ilist Pin
chandra vempati14-Jul-08 5:43
chandra vempati14-Jul-08 5:43 
AnswerRe: How to bind Listview to Ilist Pin
Mark Salsbery14-Jul-08 9:39
Mark Salsbery14-Jul-08 9:39 
AnswerRe: How to bind Listview to Ilist Pin
amistry_petlad14-Jul-08 9:41
amistry_petlad14-Jul-08 9:41 
create on class like product

and do the following things
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;


public class Product
{
private string _productName;

public string ProductName
{
get { return this._productName; }
set { this._productName = value; }
}

public Product()
{

}
}

--------------------
then create other calls

public class ProductRepository
{
public static IList<product> GetProducts(string criteria)
{
string key = "Products_" + criteria[0];

IList<product> list = CacheRepository.GetObjects<product>(key);

if (list == null || list.Count == 0)
{
list = DataAccess.GetProducts(criteria);
CacheRepository.SaveObject(key, list);
}

// return the list based on the criteria

List<product> productList = list as List<product>;

list = productList.FindAll(delegate(Product product)
{
return product.ProductName.ToLower().StartsWith(criteria.ToLower());
});

return list;
}
}

-------------------------------

public class DataAccess
{
public static IList<product> GetProducts(string criteria)
{
List<product> list = new List<product>();


// Fill the list with any data source


while (reader.Read())
{
Product product = new Product();
product.ProductName = reader["name1"] as String;
list.Add(product); //which fill the list
}
}

return list;
}
}


------------------------------

Then

in the Page_Load or any method
you can bind this way

IList<product> list = null;


Listview listview = new Listview();
listview.DataSource = list;
listview.DataBind();
GeneralRe: How to bind Listview to Ilist Pin
chandra vempati14-Jul-08 10:14
chandra vempati14-Jul-08 10:14 
GeneralRe: How to bind Listview to Ilist Pin
amistry_petlad14-Jul-08 11:34
amistry_petlad14-Jul-08 11:34 
QuestionGood wpf tutorials Pin
csciwizard12-Jul-08 9:42
csciwizard12-Jul-08 9:42 
AnswerRe: Good wpf tutorials Pin
Pete O'Hanlon12-Jul-08 10:09
subeditorPete O'Hanlon12-Jul-08 10:09 
GeneralRe: Good wpf tutorials Pin
csciwizard12-Jul-08 12:21
csciwizard12-Jul-08 12:21 
AnswerRe: Good wpf tutorials Pin
Paul Conrad12-Jul-08 12:32
professionalPaul Conrad12-Jul-08 12:32 
GeneralRe: Good wpf tutorials Pin
Yajnesh Narayan Behera21-Jul-08 0:01
Yajnesh Narayan Behera21-Jul-08 0:01 
QuestionFonts Problem in Silverlight.. Pin
Prkay11-Jul-08 2:04
Prkay11-Jul-08 2:04 
AnswerRe: Fonts Problem in Silverlight.. Pin
Sam Xavier11-Jul-08 2:39
Sam Xavier11-Jul-08 2:39 
GeneralRe: Fonts Problem in Silverlight.. Pin
Prkay11-Jul-08 2:51
Prkay11-Jul-08 2:51 
GeneralRe: Fonts Problem in Silverlight.. Pin
Michael Sync12-Jul-08 6:25
Michael Sync12-Jul-08 6:25 
QuestionObtain Child from a Grid by clicking Button Pin
ezazazel10-Jul-08 23:10
ezazazel10-Jul-08 23:10 
AnswerRe: Obtain Child from a Grid by clicking Button Pin
Brian Griggs11-Jul-08 11:18
Brian Griggs11-Jul-08 11:18 
GeneralRe: Obtain Child from a Grid by clicking Button Pin
Gideon Engelberth11-Jul-08 14:10
Gideon Engelberth11-Jul-08 14:10 
GeneralRe: Obtain Child from a Grid by clicking Button Pin
ezazazel13-Jul-08 23:54
ezazazel13-Jul-08 23:54 
QuestionHow to Bold a Particular field in a list view Pin
Aslesh10-Jul-08 3:49
Aslesh10-Jul-08 3:49 
AnswerRe: How to Bold a Particular field in a list view Pin
Yajnesh Narayan Behera10-Jul-08 4:45
Yajnesh Narayan Behera10-Jul-08 4:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.