|
Hey all
I have a gridview on my page which the you can filter. This all works fine, however when your filter returns no results the whole table disappears. Is there anyway to keep the header row visible instead of the blank screen?
Thanks in advance
|
|
|
|
|
This is how I've done it in the past:
Always include one blank or dummy row at the very beginning of the gridview's datasource datatable. Then in the gridview's RowDataBound event add code to check if it is the first row, and if it is to hide it. It would look something like this:
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
Select Case e.Row.RowType
Case DataControlRowType.DataRow
If e.Row.RowIndex = 0 Then e.Row.Visible = False
End Select
End Sub
Since the gridview has a row it will display the headers, but the row itself will be hidden.
|
|
|
|
|
Hello
I am getting the following error when I try to run my project:
Error: Project Is Not Configured To Be Debugged
I have set debug = "true" in Web.Config and also set my IIS->directory->Execute Permissions to Scripts only as advised by many other sites.
However this has not fixed my error. The Web.Config file also seems to be correct in its structure and syntax.
Just wondering if any one has had similar promblems and how they resolved them or if any one can point me in the directions of solutions i haven't tried yet
Oh i am running windows XP, VS2003.NET with version 1.1 of the .NET framework and the project uses WSE 1.0
Thanks
Dan
|
|
|
|
|
On my machine, I have set "script and executable".
Also, try to attach to the process (aspnet_wp).
One more thought: check permissions for you website
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
Just incase any one stumbles upon this with the same problem - here is how i fixed it.
in IIS->directory for the site i ticked a checkbox script source access and applied it to all child nodes. This did work but every now and then needs undoing and redoing.
Not sure why this worked nor am i sure of the consequences of checking the box so you may want to look into that before blindly following my advice (as it is rarely any good)
ttfn
Dan
|
|
|
|
|
Is there a nice easy way to check Session["x"] exists without trying and catching it?
Thanks.
|
|
|
|
|
no need to use try catch for that they are there for different purpose.
You can check the session like this:
if(Session["x"]!=null)<br />
{<br />
}
Best Regards,
Apurva Kaushal
|
|
|
|
|
Oh my I feel like an idoit!
I could have sword i tried that and it gave me an error for referencing a somthing that didn't exist
but that error was caused by another bug
Thanks for pointing it out for me
|
|
|
|
|
Always welcome..
Best Regards,
Apurva Kaushal
|
|
|
|
|
Imagine the key has not been added on the session at all, that time do we need to user only try...catch block or is there any other way will work?
Ram
|
|
|
|
|
No in that case also you can check the session like that(what I mention).
Best Regards,
Apurva Kaushal
|
|
|
|
|
I tried, it is throwing object ref not set an instance of an object exception. Are you sure
Ram
|
|
|
|
|
That is what you need to check. If you will use the session variable without assigning it then it will thow the exception exactly what you got.
So prior to use that you have to check whether that is available or not like this:
if(Session["x"]!=null)<br />
{<br />
}
here x is the variable name you change it with yours one.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi,
I have an ASP page that draws up a report and display it to the user. If the user wishes to do so, he can click a "print" button which activates the printer dialog via javascript. This would be the same as if they selected "File > Print" from the browser menu.
My problem is that at hte top of the page, page numbers are added automatically, and at the bottom the URL of the page that was printed. Is there a way to get rid of this extra information, so that a "clean" document can be printed with only the results from the report.
Any help would be appreciated,
Thanks.
mr.mark
|
|
|
|
|
There is another dialog to configure the header- and footerline in the Menu "File" -> "Configure page".
After my state of knowledge, there is no way for remote control this dialog box settings. Same statement counts for the printer dialog to configure i.e. the layout of the page.
Regards
Stephan
\\\| \\ - -
( @ @ )
+---------------oOOo-(_)-oOOo-----------------+
| Stephan Pilz stephan.pilz@stephan-pilz.de |
| <a href=www.stephan-pilz.de>www.stephan-pilz.de</a> |
| ICQ#: 127823481 |
+-----------------------Oooo------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
|
|
|
|
|
|
I am using Visual Studio 2005 Professional Edition to create a WebSite and Crystal Reports that come with it to create my reports. My problem is that when I add a new Crystal Report item, I only find three experts i.e. Standard, Cross-Tab, and Mail Label. I cannot find the Drill Down expert. What am I missing?
|
|
|
|
|
HI Every1
I have two questions.
!st one is: I am using dataset and fill this dataset in ISPOSTBACK event.On button click event,I want to bind datagrid with this dataset but when i click on this button,data is lost.Is it possible?
I declared dataset as public.
2nd one is:How to use datacache in appliction?I want to fill dataset in global.asax page in application_start event.I want to store this dataset into datacache?how can i do this?Pls if u have any ans,pls reply me.
Thanxs
monika.
|
|
|
|
|
hi,
Well I can help you with your 1st question,
Your can add this dataset either in Session or ViewState
Example.
ViewState.Add("Name for ViewState",Your dataset name) or
Session.Add("NAme for Session", datasetname)
With this i think solve your problem...
I m sorry for your second question.
Hopes it will work..
KHATRI
|
|
|
|
|
Hi,
I am working with asp.net 2.0. In my project, i am using a Design time DataSet (.xsd file). In TableAdapters i have Added a query which uses my existing Stored Procedure to retreive Data, Which accepts some Arguments. This method is below,
DALTableAdapters.ItemsTableAdapter.GetProductList(int?, int?, int?, int?, ref string, ref string, ref int?)
When i call this method from my Codebehind Class of the page,
DAL.ItemsDataTable items_dt = items.GetProductList(catId, brandId, page, '3', ref catName, ref brandName, ref numProducts);
For all the variables in the argument, i have already assigned some values.
While compiling, I am getting the following Error.
Argument '7': cannot convert from 'ref int' to 'ref int?'
How can i resolve this problem ?
Regards,
Jay
|
|
|
|
|
Hi there,
"ref int" and "ref int?" are different, see Nullable types[^], in this case you need to cast the numProducts to a variable of the nullable type int? before calling the method.
|
|
|
|
|
Thanks for your most valuable info.
It works fine, when i changed my datatype of numProducts local variable from int to int?
But i am experiencing this problem now only. In my StoredProcedure, i have passed all the parameters like this.
CREATE PROCEDURE GetProductsList<br />
@CategoryId INT,<br />
@BrandId INT,<br />
@PageIndex INT,<br />
@NumRows INT, <br />
@CategoryName nvarchar(50) OUTPUT,<br />
@BrandName nvarchar(50) OUTPUT,<br />
@ProductCount INT OUTPUT<br />
<br />
AS<br />
<br />
BEGIN<br />
.........<br />
I am using this SP for SELECT method of my ObjectDataSource.
My doubt is, Why the @ProductCount needs to be declared as int? ? No string? for @BrandName
And WHY all the OUTPUT variables are passed as Reference??
-- modified at 3:14 Saturday 23rd September, 2006
Regards,
Jay
|
|
|
|
|
Hi all
I have a dropdownlist on my page but it is always showing the value rather than the text. For example:
<asp:DropDownList runat="server" id="filter">
<asp:ListItem value="1">Filter 1</asp:ListItem>
</asp:DropDownList>
This will produce the dropdownlist but the text shown will be 1 rather that filter 1 . This happens when the listitem is declared as follows as well:
<asp:ListItem value="1" text="Filter 1" />
Any ideas on why this is happening??
The project that this page is part of uses nested master pages if this sheds anymore light.
Thanks in advance.
|
|
|
|
|
Hi,,
I tried with the same coding in a new web page and it showed "Filter 1" correctly, rather than "1" as u mentioned...
Regards..
sdaniel_cst
|
|
|
|
|
Cheers for the reply
I have also tried with the same code in a new project now and it works. Suppose this project is just being funny with me
thanks again
|
|
|
|