A Alexey Smirnov Oct 22, 2007 #2 Using code, how can I tell if a formview control has no data/records? Click to expand... I think there are few ways you can do it, you can check if Formview.DataItem, or Formview.Row are not null, you can check if datasource has rows, etc
Using code, how can I tell if a formview control has no data/records? Click to expand... I think there are few ways you can do it, you can check if Formview.DataItem, or Formview.Row are not null, you can check if datasource has rows, etc
C Cirene Nov 6, 2007 #3 Can you provide a sample? This doesn't seem to work: If me.fv1.Row Is Nothing Then
A Alexey Smirnov Nov 7, 2007 #4 Can you provide a sample? This doesn't seem to work: If me.fv1.Row Is Nothing Then Click to expand... Hi Cirene, did you check the DataItemCount Property? It seems that it would help you... If fv1.DataItemCount = 0 Then .... http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.formview.dataitemcount.aspx
Can you provide a sample? This doesn't seem to work: If me.fv1.Row Is Nothing Then Click to expand... Hi Cirene, did you check the DataItemCount Property? It seems that it would help you... If fv1.DataItemCount = 0 Then .... http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.formview.dataitemcount.aspx
G Geo Jan 28, 2008 #5 Hi, Why dont you try.. for (int i = 0; i <= [FormviewName].PageCount; i++) { //Will come here if there is data. }
Hi, Why dont you try.. for (int i = 0; i <= [FormviewName].PageCount; i++) { //Will come here if there is data. }