|
i know that gridview doesnt support
custome paging
thats why i was asking for some waythrough it .
|
|
|
|
|
Hello Friends,
I'm implementing custom paging in my GridView. Paging numbering(in-built paging numbering) does not display but it brings the records are queried . Below giving my code please let me know what changes i should make in my code. But if i use in-built paging(normal paging) then that's working fine......
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
lblMsg.Text = e.NewPageIndex.ToString();
int pageNumber=Convert.ToInt32(e.NewPageIndex);
int recordPerPage= 4;
int startRecord = (pageNumber) * recordPerPage + 1;
int maxRecord = startRecord + recordPerPage;
bindGridView1(startRecord,maxRecord);
}
public void bindGridView1(int startRecord,int maxRecord)
{
string connectionString = "server=.;database=Auto_New;uid=sa;pwd=;";
using(SqlConnection mCon = new SqlConnection(connectionString))
{
SqlCommand mDataCom = new SqlCommand();
mDataCom.Connection = mCon;
mDataCom.CommandType = CommandType.StoredProcedure;
mDataCom.CommandText = "SP_Select1";
mDataCom.Parameters.AddWithValue("@startRecord", startRecord);
mDataCom.Parameters.AddWithValue("@maxRecord", maxRecord);
SqlDataAdapter da = new SqlDataAdapter(mDataCom);
DataSet ds = new DataSet();
da.Fill(ds);
GridView1.DataSource = ds.Tables[0];
GridView1.DataBind();
}
}
|
|
|
|
|
Hi All,
I have a table with headers as below, table displyed with a horizontal and vertical scroll bars within DIV tag. When it is displayed in IE browser headers width is normal but when they are displayed in Mozilla or Safari browsers they are displayed with reduced column widths when compared with its items below.
I found the reason for this is below code(overflow: ovfl), but when I put the overflow: auto here the header widths are proper but when we scroll vertical bar headers are going inside of the DIV tag.
if(DIV_Array.clientHeight>290){$(TAB_Array).fixedHeader({width: 900,height: h, overflow: ovfl});}
Can anybody give me advice to make the headers fixed and their widths are also fixed according to the width of columns.
Thanks in advance.
This is the table header part
<th class="RowHeader2Cell1" align="left" style="white-space:nowrap;width:20%;">Asset Name</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">CUSIP</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">ISIN</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">SEDOL</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Ticker</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Current Allocation</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Quantity</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Current Price</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Date Priced</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Market Value</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Total Cost</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Unrealized Gain/Loss</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Estimated Annual Income</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Yield</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Portfolio</th>
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
Hi dear try this...
How to Freeze GridView Header While Scrolling ?
This is very common problem in Web development that we need to freeze the GridView header at the time of scrolling, Here is one simple tips:
Step 1 : Create a CSS class as following
view plaincopy to clipboardprint?
1. .HeaderFreez
2. {
3. position:relative ;
4. top:expression(this.offsetParent.scrollTop);
5. z-index: 10;
6. }
Step 2 Set Gridview’s HeaderStyle CssClass as follows
CssClass="HeaderFreez"
That’s all. Some times we need also maintain the scroll positions while selecting any data from GridView, and quite difficult to maintain the position while we are using AJAX, I have written a complete article on that, hope this will help Maintain GridView Scroll Position inside updatepanel
|
|
|
|
|
Hi,
I am not using gridview instead I am using table here. Still can I use the same CSS for my purpose also.
Thanks,
Md Abdul Aleem.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
Hi dear try this
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
}
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #FF0000; }
.HeaderFreez
{
position:relative ;
top:expression(this.offsetParent.scrollTop);
z-index: 10;
}
-->
</style>
</head>
<body>
<p>
<div style="height:100px;width:200; overflow: scroll;">
<table width="200" border="1" cellspacing="0" cellpadding="0">
<tr class="HeaderFreez" bgcolor="#000000" >
<td class="style1"><span class="style3">Number</span></td>
<td class="style1"><span class="style3">Text</span></td>
<td class="style1"><span class="style3">Other</span></td>
</tr>
<tr>
<td>1</td>
<td>a</td>
<td>!</td>
</tr>
<tr>
<td>2</td>
<td>b</td>
<td>@</td>
</tr>
<tr>
<td>3</td>
<td>c</td>
<td>$</td>
</tr>
<tr>
<td>4</td>
<td>d</td>
<td>%</td>
</tr>
<tr>
<td>5</td>
<td>e</td>
<td>&</td>
</tr>
<tr>
<td>6</td>
<td>f</td>
<td>*</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div></td>
</tr>
</table>
</div>
</body>
</html>
|
|
|
|
|
Hi,
I am able to create the scroll bars but my problem is the headers widths are differing with column widths. The header widths are decreasing where as the column widths are remaining same.
This problem is coming only in Mozilla browsers. But if I say overflow:auto for its properties its header widths are good, but header is becoming invisible when I scroll down.
Thanks,
Md Abdul Aleem.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
Hi,
It was working fine until I drag the vertical scroll bar down, but when I scroll it down again its header widths are changing.
As that part belongs to the following CSS, can you please suggest me what change should I do to make the headers freezed even if vertical scroll bar is dragged.
.HeaderFreez
{
position:relative ;
top:expression(this.offsetParent.scrollTop);
z-index: 10;
}
Thanks in advance,
Md Abdul Aleem.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
can someone explain if i need to use all the three lines of code mentioned below to disable the cache in a page.actually if i am using only Response.CacheControl = "no-cache" then also page is working properly.then what is the use of another two line..and also is it a server side cache or client side?
Response.CacheControl = "no-cache"
Response.AddHeader("Pragma", "no-cache")
Response.Expires = -1
|
|
|
|
|
I think for client cache only Response.Expires will do. No need for those cache headers.
|
|
|
|
|
Hello Guys,
Is there a way to display the images as rounded rectangle?
Thanks in advance
|
|
|
|
|
Your best bet is to change the image before sending it to the client, but I believe a rounded rectangle effect can be created with css. I am not sure how, you'd have to google it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hello.
I finished a bullentin board with Repeater on my pages .
I would like to make a seaching box(?) to show up a result on the list of Repeater, when someone searchs something by inputting on textbox.
So, I put Dropdownlist, Textbox and imagebutton through tool box on the page.
I mean I would like to make something like "Search" on top of this page.
Search [ Text Box ] [Dropdownlist] [button]
And I'm coding like the following code.
protected void Select_Btn1_Click(object sender, ImageClickEventArgs e)
{
string title;
title = Search_Txt1.Text;
if (DropDownList1.SelectedValue== "Title")
{
SqlConnection cn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["aspnetdbConnectionString"].ConnectionString);
string sql = "Select * From t_Pds where Title = '"+ Title +"' ";
}
}
But I don't know how to show up the result on the list of Repeater.
|
|
|
|
|
Well, you have bigger issues than that. The obvious solution to your immediate problem ( apart from the general poor coding style ), is to run your SQL and bind your repeater to the result. Your bigger issue, is that I can erase your bullitin board simply by typing in the right search term. Do some research on SQL injection attacks.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hey,
Just you can do like this :
SqlConnection cn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["aspnetdbConnectionString"].ConnectionString);
string sql = "Select * From t_Pds where Title = @p_search ";
SqlCommand cmd = new SqlCommand(sql,cn);
cmd.Parameters.add("@p_search",SqlDbType.VarChar,100);
SqlDataAdapter sAdpt = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
sAdpt.Fill(ds, "t_Pds");
Now you bind the sql to the Repeater:
yourrepeater.DataSource = ds.Tables["t_Pds"];
yourrepeater.DataBind();
|
|
|
|
|
I create a stored procedure and call that the procedure through on linq.
databasecontext db=new databasecontext();
var results=db.sp_insert_logindetails();
Now i want to convert the results into dataset or datatable. Anybody help me
sp_insert_logindetails is a procedure name
it executes this query: - select * from logindetails
damodharan
|
|
|
|
|
i want the answer for the same question .. can anyone help..
i am using stored procedure with linq, i want the result of that stored procedure to come in dataset.. anybody please...??
|
|
|
|
|
Hi,
What happen when a music player is created and play the file from server, will the music file is downloaded to the client system or it play from server?
If it download to the client system, where it save?
Thankyou
YPKI
|
|
|
|
|
The music player is probably going to cache it internally, but I guess it depends on which player you use.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I created player using Object tag and Embed tag.
for eg:
<object id="" classid="" type="" url="" voume="" .......="" <="" object="">
i load and play a music file from server, what happening in the backend? will it dounload or cache it internally?
if it cache, any file will created in client system?
|
|
|
|
|
Hi
I am creating my first ASP.net Project(C#)....
my project is Student Project Allocation using Genetic Algorithm...... I have no idea in Genetic Algorithm..... can Any one explain what is Genetic Algorithm and how to implement in ASP.
Thanks In Advance
|
|
|
|
|
You need to talk to your teacher about what a genetic algorithm is, and/or refer to your textbooks. You could also try google. While one could be used in an ASP.NET application, it has nothing to do with ASP.NET, or even ASP, which is not the same thing.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
hai guys,
sagnik mukherjee has posted an article which does pagination based tablepagination but i want numeric pagination using jquery pagination plugin.. Can we implement it
|
|
|
|
|
Who is sagnik mukherjee ?!
Search inside CP forum and you will find.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|