How to show the Empty Grid view in asp .net .... it possible then please tell me how?.

thanks in advance


Bala..

kvprajapati commented: You have to use suitable title for your question. -2

Recommended Answers

All 2 Replies

As far as i know you cant, if there is no data it will not show, if i may ask why do you want to show an empty Gridview ?

How to show the Empty Grid view in asp .net .... it possible then please tell me how?.

thanks in advance


Bala..

I assume your purpose that you wanted to show header and footer of gridview even if there is no row.

if (dtFunding.Rows.Count != 0) {     grdFunding.DataSource = dtFunding;     
grdFunding.DataBind(); } 
else {   //Other wise add a emtpy "New Row" to the datatable and then hide it after binding.       
dtFunding.Rows.Add(dtFunding.NewRow());      grdFunding.DataSource = dtFunding;      
grdFunding.DataBind();      
grdFunding.Rows[0].Visible = false; }

Specs: Just add empty datarow to dataset/datatable then bind it to gridview

Mark as solved if it helps you!!!!

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.