How can you force an ASP.Net GridView to display an EmptyDataTemplate given there's only a single data record with all blanks? -


my stored procedure, instead of returning 0 rows, returns 1 of columns null. when .net code sees such data, wish force display emptydatatemplate. how?

thanks win,

in linqdatasource selecting event handler check if data source has size of 1 , has null value 1 of key fields , pass in linqdatasourceselecteventargs' result:

using (var datacontext = new webdatacontext()) {   var report = row in datacontext.getreport()   select new report()   {     accountcode = row.accountcode //,    //...   } }  if (report.count() == 1 && report.tolist()[0].accountcode == null) {   var emptyreport = report.tolist();   report.clear();    e.result = emptyreport; } else { //...   e.result = matrixreport; //... } 

Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -