|
Actually previously you were using datagrid where it is working fine but here it seems that you are using gridview and here it doesnot work. BTW in 2005 also you can use datagrid unless you have some specific reason to use the gridview.
Best Regards,
Apurva Kaushal
|
|
|
|
|
No we have been told to use GridView.Please tell me any other way you know.
|
|
|
|
|
Here in gridview what you can do is to create a headertemplate and then put the control you want and then use it.
Also you can have a look at this link[^]. The same thing is being implemented here in Gridview.
Best Regards,
Apurva Kaushal
|
|
|
|
|
No its not working.I need the image also....
|
|
|
|
|
What is not working? Have you followed the content in the article or you tried it with just applying headertemplate control.
Best Regards,
Apurva Kaushal
|
|
|
|
|
I cant see headertemplate Control??how do I start???
|
|
|
|
|
It would be something like this inside the gridview:
<code><asp:TemplateField>
<HeaderTemplate>
<asp:Label ID="ii" runat="server">kaushalk</asp:Label>
</HeaderTemplate>
</asp:TemplateField></code>
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi to all,
I need to know.... how to create One click installer for web project for VS 2003.
Thanks in advance
Sajjad
|
|
|
|
|
|
thanx man
|
|
|
|
|
Hello & Smiles,
I had to add a new field to one of my old projects which was designed using Datagrid, it is a checkbox field with datatype as 'Bit'(SQL 2005)same as boolean. I added the checkbox in datagrid as below:
<asp:templatecolumn headertext="Current Driver?">
<itemTemplate>
<asp:checkbox id="cbcurrentdriver" runat="server" autopostback="true" checked='<%# DataBinder.Eval(Container.DataItem,"currentdriver") %>' />
</itemTemplate>
</asp:templatecolumn>
In the Insert and Update Sub's I added the code as below:
Dim chkbox As CheckBox = CType(e.Item.Cells(9).FindControl("cbcurrentdriver"), CheckBox)
If chkbox.Checked = True Then
Command.Parameters.Add("@currentdriver", SqlDbType.Bit, 2).Value = "True"
Else
Command.Parameters.Add("@currentdriver", SqlDbType.Bit, 2).Value = "False"
End If
Also, included the field in Databind for Datagrid with select * from etc...
This works fine when I open the page in update mode and shows the status of checkbox as checked or unchecked depending upon it's value in database.
My datagrid has a feature 'Add New row' which blank row and this part fails giving me the error -
Conversion from type 'DBNull' to type 'Boolean' is not valid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Conversion from type 'DBNull' to type 'Boolean' is not valid.
Source Error:
Line 1175:<asp:templatecolumn headertext="Current Driver?">
Line 1176:<itemTemplate>
Line 1177:<asp:checkbox id="cbcurrentdriver" runat="server" autopostback="true" checked='<%# DataBinder.Eval(Container.DataItem,"currentdriver") %>' /></itemTemplate>
Line 1178:
I have been struggling with Null checks for checkboxes etc... for last two days. Any help is Gratifying.
Thankyou.
Aartee.
...HE is watching Us All!
|
|
|
|
|
hi , try to use default value in database as 'F'.it may help u
thanks and regards,
Kinnu
|
|
|
|
|
Hello Kinnu,
Thankyou for your reply.
I did try giving it a default value 'F' with 7 without quotes, I even tried default value false and NULL but it didn't work and SQL database is giving me an error when I type the default value as: Error validating the default value for column 'currentdriver'. It does not give me this error when I enter default value as NULL or 0 but my program is still not working and giving me the same conversion (DBNULL to Boolean) error.
Thanks once again. Please let me know if you have any other tips or suggestions.
Aartee.
...HE is watching Us All!
|
|
|
|
|
Since this is a bit column you need the default value to be 0 which is false and then you would avoid this. Also if you dont want a default value, create a Protected Function in the code behind and pass the value from the Datagrid DB value and accept it as an Object, check for DBNull and if it is return a 0/False whatever works.
Cleako
|
|
|
|
|
Hi gyes, I have installed vs.net and I am trying to build a new web project, but it does not accept this action and it displays an error message which says that:
Visual Studio .NET has detected that the specified Web server is not running ASP.NET version 1.1. You will be unable to run ASP.NET Web applications or services.
is there any one has an idea to solve this problem??
kind regards
Kind Regards
OBarahmeh
Palestinian Central Bureau of Statistics (PCBS)
Ramallah-Palestinian Territory
|
|
|
|
|
run aspnet_regiis -i from your .NET 1.1 folder ( c:\windows\microsoft.net\framework\v1.1.something)
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi,
i have also met that problem. first u chk the web server that is IIS is install properly or not. if not plz reinstall the IIS and try again...
i done that.... only...
|
|
|
|
|
i have a web page with a textbox and a listbox.
the data to be displayed in the listbox is stored in an array on the client side.
i need to trap the keys when the users types in the textbox, and display the data related
to it from the data stored inn the array and populate the listbox(on the client side).
thanks
any kind of help would be appreciated
|
|
|
|
|
You can handle onkeyup event of textbox and populate listbox with neccessary items in it
function getKeyCode (e_) {
return parseInt(e_ ? e_.which : window.event.keyCode);
}
function srcEl(e_) {
if (window.event)
return window.event.srcElement;
else
return (e_ ? e_.target : null);
}
function onKeyUp(e) {
var textbox = srcEl(e),
keyCode = getKeyCode(e);
var text = textbox.value;
....
fill list box based on "text" string
....
}
textbox.onkeyup = onKeyUp;
|
|
|
|
|
Hi Folks,,
I have a web page with multiple buttons on it...Each button is responsible for retriving and presenting information on this web page...
I want to implement caching on this web page where I can vary the page depending upon which button caused the postback...
Can anyone suggest how can I achieve this...
Joel
JO
|
|
|
|
|
Hi there:
I'm not sure what you need about caching based on e.CommandName...
For caching...just simply load data and put it into cache...
<< >>
|
|
|
|
|
I dont wanna cache the entire data set...I just wanna vary the cache based on the commandName property of all my button controls..
Thanks
joel
JO
|
|
|
|
|
So what is your problem when do caching based on that commandName...?I think, when a button is cliecked...you just check if the data is already cached or not...if not, load from DB and cache it...if already, just read from cache...is that ok?
<< >>
|
|
|
|
|
Actually I am using Output caching ..not data caching..
<%@ OutputCache Duration="120" VaryByParam=
I wanna cache different versions of the page depending on the commandname argument...
JO
|
|
|
|
|
Hello all,
I have been working on this project for quite some time now and to be honest i cant stand it anymore! I have a simple request, i want to get a parameter, taken from a querysting and pass it to a crystal report.
I have setup the crystal report viewer on my default.aspx page and by setting the default value of the parameter, i am able to view the crystal report. Here is the follwing code that i use
---------------------------------------------------------------------------------
<CR:CrystalReportViewer ID="rptViewer" Runat="server" AutoDataBind="True"
Height="947px" ReportSourceID="CrystalReportSource1" Width="845px" DisplayGroupTree="False" EnableDatabaseLogonPrompt="True" HasRefreshButton="True" />
<CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
<Report FileName="SS_Server.rpt">
<Parameters>
<CR:Parameter ConvertEmptyStringToNull="False" DefaultValue="45"
Name="SERVER_ID" ReportName="" />
</Parameters>
</Report>
</CR:CrystalReportSource>
------------------------------------------------------------------------------------
This code works fine, however i want to have the parameter SERVER_ID to be taken from a querystring sent to this page! Si in my innocence i thought, instead of having the defaultvalue="45" can i use DefaultValue=" <% response.write request.querystring('server_id') %>" but this doesnt work.
I have read somewhere that like a control parameter one can code a querystring parameter! Does anyone know how to do this??
Im sure someone can help me, the idea behinf this is so simple, but im only new to Asp and am not sure where im goin wrong.
If anyone can help it would be greatly appreciated!
|
|
|
|