i have two gridviews....
first one--->Topic ,
second one is Question papers
1) when ever user click on first Topic database receive only first 15 questions display?
2) user click on second Topic database receive 16 to 30 question display?.....ect
how display .....plz help me ,,....


Jitendra KumarRank #760 · 3K reputationPosted Dec 10, 2014, 8:52 PM EST
May this help you.
find attached copy of code.
If this post is useful then mark it as "Accepted Answer".
Jitendra KumarRank #760 · 3K reputationPosted Dec 7, 2014, 6:22 PM EST
Explain in proper requirements.
May this help you.
http://www.aspsnippets.com/Articles/Transfer-Selected-Rows-from-one-GridView-to-Another-in-Asp.net.aspx
http://www.aspdotnet-suresh.com/2013/05/move-selected-gridview-rows-to-another.html
Jitendra KumarRank #760 · 3K reputationPosted Dec 10, 2014, 7:52 AM EST
May this help you.
Aspx code :
CS Code :
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Bindgv();
}
}
protected void Bindgv()
{
SqlConnection con = new SqlConnection("data source=LENOVO;initial catalog=practise;UID=sa;PWD=connect;");
con.Open();
SqlCommand cmd = new SqlCommand("SELECT TopicId, TopicName FROM tbl_Topic", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
gvTopic.DataSource = ds;
gvTopic.DataBind();
}
protected void gvTopic_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName=="Select")
{
SqlConnection con = new SqlConnection("data source=LENOVO;initial catalog=practise;UID=sa;PWD=connect;");
con.Open();
//Write your logic to get question
//SqlCommand cmd = new SqlCommand("SELECT QuestionId, QuestionName FROM tbl_Question -- where 'Your logic for get Code 1 to 15 etc topicwise'", con);
SqlCommand cmd = new SqlCommand("SELECT QuestionId, QuestionName FROM tbl_Question", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
gvQues.DataSource = ds;
gvQues.DataBind();
}
}
}
Also find attached copy of code.
If any doubt kindly revert me.
Jitendra KumarRank #760 · 3K reputationPosted Dec 10, 2014, 5:25 PM EST
Kindly provides database table with record.
Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Dec 7, 2014, 5:59 PM EST
what kind of help u need ?
Chinna NethaRank #5,573 · 294 reputationPosted Dec 10, 2014, 2:50 AM EST
USER CLICK ON A TOPIC 1 TO 15 QUESTIONS... HOW TO DISPLAY?
USER CLICK ON B TOPIC 16 TO 31 DISPLAY....IN SAME GIRD VIEW
Chinna NethaRank #5,573 · 294 reputationPosted Dec 10, 2014, 4:22 PM EST
help me plz
Chinna NethaRank #5,573 · 294 reputationPosted Dec 10, 2014, 5:40 PM EST
ID
2) Topic table
Chinna NethaRank #5,573 · 294 reputationPosted Dec 10, 2014, 10:58 PM EST
again again thank you so much
:) :) =D
Saber ShaikhRank #1,686 · 905 reputationPosted Jan 4, 2015, 7:47 PM EST