I am trying to add paging to the data that I am displaying on screen, but it doesn't work. Whenever data is returned it is always the complete dataset (over 100 records, which should produce a page for every 10 records), and it always starts on page number 0. Here is my code :
XSL :
<?xml...
Is it possible to create a table with gridlines like a .NET control, rather than just setting the border to greater than 0?
Here is the XSLT I am trying to do this with :
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"...
Craig,
If so, what would be the point of this line :
GetTarget(decimal.Parse(Eval("Target", "{0:###0.00}").ToString())).ToString("N2")
Surely the {0:###0.00} would do the same job, you don't need both {0:###0.00} and ToString("N2")? Or am I wrong?
I've been working with the gridiview control for a few weeks now, and I saw some code like this :
<ItemTemplate>
<asp:Label ID="lblTarget" Text='<%# GetTarget(decimal.Parse(Eval("Target", "{0:###0.00}").ToString())).ToString("N2") %>' runat="server"></asp:Label>...
I've been working with the gridiview control for a few weekd now, and I saw some code like this :
<ItemTemplate>
<asp:Label ID="lblTarget" Text='<%# GetTarget(decimal.Parse(Eval("Target", "{0:###0.00}").ToString())).ToString("N2") %>' runat="server"></asp:Label>...
I thought you couldn't do a data type conversion in the declaration of the gridview? I would be interested to know what the syntax is for doing this.
I've managed to get it working using this approach :
<asp:TemplateField HeaderText="Target (%)" SortExpression="TargetPercentage">...
Is it possible to perform calculations on data in your gridview in your ASP, or do you need to do any calculations in the OnRowDataBound event? Here is what I am trying to do :
<asp:TemplateField HeaderText="Target (%)" SortExpression="TargetPercentage">...
The only thing that I could think of was that I am not explicitly passing the DataKey field to the stored proc, and maybe it is getting passed automatically without me knowing. But I have tried to explicitly pass it and it still gives me the same error.
I am using a SqlDataSource with a GridView and stored proc, and I have specified exactly the same update parameters for the SqlDataSource in exactly the same order as my stored proc. Yet I keep getting the error 'Procedure or function <stored procedure name> has too many arguments specified'...
Can I not set a role for the user on login and then in web.config configure it so that only people in certain roles can view any of the pages in the admin folder?
I have some code of my own where I am checking a username/password against a database for login, I am not using any of the login controls etc. What I want to do next is to create a folder for my admin pages and make it only available to administrators. At login I set an int which if an admin...
I am using the following code to export my gridview to excel :
protected void btnExport_Click(object sender, ImageClickEventArgs e)
{
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
Response.Charset = "";
//...
The error doesn't occur on this line, it occurs after all the update code has been executed, which is strange. I've decided to scrap the output parameter as it wasn't totally necessary, thanks for you help anyway.
Cheers,
Mike
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.