Hi
How can I check whether a listview has text in a particular row?Is there a method like
if(istviewname.Items[row no].Text ==" ")
{code}
else if(istviewname.Items[row no].Text !=" ")
{ code}
Can anyone help me?
Thanx
Lakshith 0 Newbie Poster
Recommended Answers
Jump to PostHello Lakshith you are most welcome on DANIWEB!
Of course there is a method! You've just wrtten it.
Two remarks:
***> " " is text, it is a string containing one char: the space. Use "" or string.Empty here.
***> because you test for two opposite things you don't have …
Jump to PostHow many rows are there in your listview?
Jump to PostI presume that your program uses DataTable. Here is sample,
DataTable dt = new DataTable(); dt.Columns.Add("No",typeof(long)); dt.Columns.Add("Name"); dt.Rows.Add(1, "A"); dt.Rows.Add(2, "B"); listView1.View = View.Details; int i; // Header for (i = 0; i < dt.Columns.Count; i++) listView1.Columns.Add(dt.Columns[i].ColumnName); // Rows for (i = 0; i < dt.Rows.Count; i++) …
All 9 Replies
ddanbe 2,724 Professional Procrastinator Featured Poster
Lakshith 0 Newbie Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
Lakshith 0 Newbie Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
Lakshith 0 Newbie Poster
Lakshith 0 Newbie Poster
kvprajapati 1,826 Posting Genius Team Colleague
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.