I want to give different colors to alternate rows of listview Control in asp.net(c#).
How can i do this?
MARKAND911
-1
Junior Poster
Recommended Answers
Jump to PostI am sure there are better ways but here is my method.
bool red = true; MyCon.Open(); SqlDataReader search = search = new SqlCommand("SELECT something FROM somewhere WHERE condition", MyCon).ExecuteReader(); ListViewItem temp;// = new ListViewItem(); while (search.Read()) { temp = new ListViewItem(); temp.Text = search.GetString(0); temp.SubItems.Add(search.GetString(1)); //etc. …
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.