I have a Table used to display an Address. Not every user fills in every field and at diplay time i'd like to just remove the Rows that have no data.
I did this so far
This works fine, what I was thinking was that I could, in the databound event, loop through the Rows and see which, if any had no contents and jest Delete It?
Not sure where to start there though.
I did this so far
var recipientContact = from ro
in
recipientOrg.AsEnumerable()
join rc
in
_db.RecipientContacts
on ro.RecipientOrganizationID equals rc.RecipientOrganizationID
select
new
{
OrgName = rc.RecipientOrganization.Name,
ContactName = rc.FirstName +
" "
+ rc.Surname,
Address1 = rc.Address1,
Address2 = rc.Address2,
City = rc.City.CityName,
Province = rc.Province.NameEnglish,
Country = rc.Country.CountryName,
PostalCode = rc.PostalCode,
Fax = ro.FaxNumber,
Phone = ro.PhoneNumber
};
table5.DataSource = recipientContact.ToList();
private
void
table5_ItemDataBound(
object
sender, EventArgs eventArgs)
{
}
This works fine, what I was thinking was that I could, in the databound event, loop through the Rows and see which, if any had no contents and jest Delete It?
Not sure where to start there though.