|
If i'm not mistaken thats because the number of rows in the gridview will be equal to the pagesize.
I have an Idea how to fix it but it hard to explain.
If you could paste you Paste you Code behide page and your aspx page I could try and sort it out for you.
|
|
|
|
|
Um well if you just use the code that I provided and put it on a gridview with a certain amount of rows, you can test it that way.
You can try explaining you like?
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
Here I just Used 20 cause I new the number of Rows,
if you are also using a DataSet just assign a session variable to it.
private void FillGridView()
{
DataSet ds = SqlHelper.ExecuteDataset(Connection, CommandType.Text, "SELECT TOP 20 * FROM Users");
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
}
private void FillDDL(DropDownList myDDL, int NumberRows)
{
for (int i = 0; i < NumberRows; i++)
{
myDDL.Items.Add(new ListItem((i + 1).ToString(), (i + 1).ToString()));
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
FillDDL(((DropDownList)e.Row.FindControl("DropDownList1")), 20);
((DropDownList)e.Row.FindControl("DropDownList1")).SelectedValue = (e.Row.RowIndex + 1).ToString();
}
}
|
|
|
|
|
Hi
I tried your code and as soon as I put pagesize in it doesnt work, is there a way around this?
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
When doesn't it work. When you build the website. When you open the page.
You also need to set autopaging = true in your GridView Properties.
|
|
|
|
|
Theres no such thing as autopaging
do you mean allowpaging?
Well no values appear in the dropdown when I specifiy the pagesize. do you not get that?
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
Ya.
Set Allowpaging = true;
No I don't get that. Very strange. Actually pagesize does nothing to my page unless i set allowpaging = true;
so thats very strange. You are setting Allowpaging in GUI not in code hey.
|
|
|
|
|
GridView.Rows.Count; Will get the number of rows in the gridView.
Or in the OnDataBound event
protected void GridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
}
}
|
|
|
|
|
hi
i want to create to web parts for my web base project. any body help me
i used C#
|
|
|
|
|
I have no clue what you are trying to ask here.
Please rewrite this so a it'r readable.
|
|
|
|
|
|
At what stage of the process do you have trouble; creating the code or deploying the web part?
|
|
|
|
|
when i run the below coding i m getting the error 'System.Data.DataRow.DataRow(System.Data.DataRowBuilder)' is inaccessible due to its protection level
help me... the coding is below..
DataTable dttable = new DataTable();
DataRow dtrow;
DataColumn dtCol;
sqlda = new System.Data.SqlClient.SqlDataAdapter("select col from tbl_test", conn);
sqlda.Fill(ds);
if (ds.Tables[0].Rows.Count != 0)
{
for (int i = 0; i<ds.tables[0].rows.count;> {
dtrow = new DataRow("" + ds.Tables[0].Rows[i][0].ToString() + "");
dttable.Rows.Add(dtrow);
}
}
|
|
|
|
|
try this code.
sqlDataAdapter da = =new sqlDataAdapter("Select col from tbl_test',conn);
Dataset ds = new DataSet;
da.fill(ds,"tab");
DataTable dt = new DataTable();
dt = ds.table(0);
DataRow dr = DataRow();
for each dr in dt.rows
Messagebox.show(dr.row[o].ToString());
next
|
|
|
|
|
sorry man...
more errors in your coding...
1. we cant user DataRow dr=DataRow();
2. there is no messagebox.show in asp.net 2.0
Can anyone help me plz?
i needed : i have set of values in my dataset and i want to create new row in datatable and insert the dataset value one by one. i.e., if dataset consist of 10 values, then ten rows is to be created and the row[0].column[0] to row[9].column[0] should contain the dataset values.
|
|
|
|
|
|
Can anyone suggest some good, online DNN resources? I'd like an architectural overview, i.e. how modules fit into a portal framework etc. as well as some guidelines for using standard modules. The official online documentation is only describable as sad.
|
|
|
|
|
Get it
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Can anybody explain about the caching and its types. What r the differences among the output caching, fragment caching and application caching. And What abt Data caching. tnx in adv.
Balasubramanian K.
|
|
|
|
|
Explained in your latest post.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Hi friends i have an issue with grid view update functionality
The problem is when i edit one of my grid view columns and click update
The GridView1_RowUpdating method which contains the
string textlastname = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox1")).Text;
returns the old value in the column instead of the newly edited value.
I need to get the newly edited value in the textlastname.
TextBox1 is the id of the control
Any help is highly appricated
praveen
|
|
|
|
|
check the "textlastname" value before update and by default set textlastname=""
|
|
|
|
|
|
hi friend
this is wrong method.
you want to retrive data from GridView.
first you select row.
then select column.
|
|
|
|
|
how to implement dialogbox using javascript ?
dheeraj
|
|
|
|