How to show empty row on grid view in asp.net
I have a grid view that contain 25 records, in page size property set to 10 records per page. It have 3 pages, in the final page it displays only 5 rows, Here it show 10 rows. (First five records then next five as empty rows) Please post the help.

Manoj Kumar Mandal198 reputationPosted Apr 28, 2015, 2:20 AM EDT
Try this code
int rowcount = dt.Rows.Count;
int remainingCount = 10 - (rowcount % 10) ;
for (int i = 0; i < remainingCount; i++)
{
DataRow row = dt.NewRow();
dt.Rows.Add(row);
}
ashok kumar30 reputationPosted Apr 28, 2015, 12:47 AM EDT
Please Help me
Thanks in Advance
ashok kumar30 reputationPosted May 10, 2015, 9:36 PM EDT
I have one dropdownlist which contain value of school and office i have also table in school and office i have also grid. when i select school in dropdownlist the grid display must the school table and vivice-versa.
Thank You,
Manoj Kumar Mandal198 reputationPosted May 10, 2015, 11:34 PM EDT
Sample Code
protected void DropDownList1_SelectedIndexChanging(object sender, EventArgs e)
{
int TypeId= Convert.ToInt32(DropDownList1.SelectedValue);
//Call your procedure with TypeId as argument
}
Inside Procedure use condition
IF (TypeId = 1 )
BEGIN
//Query to fetch data of School
END
ELSE IF (TypeId = 2)
BEGIN
//Query to fetch data of College
END
ELSE
BEGIN
//Query to fetch data of Office
END
Sibeesh VenuRank #27 · 42.9K reputationPosted Apr 28, 2015, 12:29 AM EDT
So you want to add 5 empty rows to the grid? If yes why don't you just add 5 extra rows to your data source and assign it. I could not find out any difficulty to do so. Please elaborate your question.
Please up vote and accept if it helps you.
Kindest Regards
Sibeesh Venu
www.sibeeshpassion.com