how to display two columns in gridview

Posted by Suneel161 under Regular Expressions on 4/8/2010 | Views : 4332 | Status : [Member] | Replies : 2
i have 2 columns in a grid view ,i have taken page size (10) is fixed, i need to get 10 rows and next record should be continued in the same page.how to solve this in gridview..




Responses

Posted by: Vuyiswamb on: 4/8/2010 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
What you are looking for is called Paginating and its easily done here like this

http://www.dotnetfunda.com/articles/article307-paging-without-a-wizard-sqldatasource-control-in-aspnet-.aspx

Thank you for posting at Dotnetfunda

Vuyiswa Maseko


Thank you for posting at Dotnetfunda
[Administrator]

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naveenmanam on: 4/12/2010 [Member] Starter

Up
0
Down


 

<asp:GridView ID="GridView1"
runat="server"
Height="293px"
Width="674px"
AllowPaging="True"
OnPageIndexChanging="GridView1_PageIndexChanging">
</asp:GridView>


private void GetData()

{

DataSet Curriculat = new DataSet();



BLL.BLL obj = new BLL.BLL();



Curriculat = obj.GetData();





GridView1.DataSource = Curriculat;



GridView1.DataBind();

}

 protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)


{

GridView1.PageIndex = e.NewPageIndex;

GetData();

}


NaveenKumar

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response