473,725 Members | 2,276 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

<asp:TemplateCo lumn >

Das
Hi All
I'm using Temple column in Asp.Net
if works fine, but I directly want to set the checked property.
With Text Property: it works fin
<asp:TemplateCo lumn HeaderText="Red Flag"><ItemTemp late><asp:Check Box Text= '<%# DataBinder.Eval (Container.Data Item, "strRedFlag ") %>' runat="server"/></ItemTemplate></asp:TemplateCol umn

I want to set lik
In the code below I'm setting the Checked property <asp:CheckBox checked=> instead of Text Property(as in the example above. The code is compiled corretyly. But at run time it gives the Invalid cast exception. My strRedFlag field will return string '0' or '1' In database I have converted that to boolean but it gives the same error. on the form I want to convert it to boolean value. Can any one help me.
<asp:TemplateCo lumn HeaderText="Red Flag"><ItemTemp late><asp:Check Box checked= '<%# DataBinder.Eval (Container.Data Item, "strRedFlag ") %>' runat="server"/></ItemTemplate></asp:TemplateCol umn
Thanks in Advance
Das
Nov 16 '05 #1
1 2078
hi das
i dont think there is any problem.
a wild guess did u turn off the ViewState of the datagrid????
if it is sql server make sure that the field is of bit datatype

HTH
Happy



"Das" <an*******@disc ussions.microso ft.com> wrote in message
news:5E******** *************** ***********@mic rosoft.com...
Hi All,
I'm using Temple column in Asp.Net
if works fine, but I directly want to set the checked property.
With Text Property: it works fine
<asp:TemplateCo lumn HeaderText="Red Flag"><ItemTemp late><asp:Check Box Text= '<%# DataBinder.Eval (Container.Data Item, "strRedFlag ") %>'
runat="server"/></ItemTemplate></asp:TemplateCol umn>
I want to set like
In the code below I'm setting the Checked property <asp:CheckBox checked=> instead of Text Property(as in the example above. The code is
compiled corretyly. But at run time it gives the Invalid cast exception. My
strRedFlag field will return string '0' or '1' In database I have converted
that to boolean but it gives the same error. on the form I want to convert
it to boolean value. Can any one help me. <asp:TemplateCo lumn HeaderText="Red Flag"><ItemTemp late><asp:Check Box checked= '<%# DataBinder.Eval (Container.Data Item, "strRedFlag ") %>'
runat="server"/></ItemTemplate></asp:TemplateCol umn> Thanks in Advance,
Das

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1253
by: Martin Jacobsson | last post by:
Hi! I have just installed VS.NET 2003, I have problem with intelisense in <asp:>-tags in aspx-files. I prevoiusly ran VS.NET and had no problems with this. Is it some property on the project or in the environment that I am not aware of? br Martin Jacobsson
1
1648
by: s8chem | last post by:
I'm working with an XSL document that renders ASP.NET Server Controls. In order to do this, I have to declare an "asp" namespace within the XSL document. This namespace is the same as when you see a line like this: <asp:label> in an ASPX page. My question is where is this namespace declared? In an XSL document you see a line such as: xmlns:xsl="http://www.w3.org/1999/XSL/Transform" which points to a URI that resolves the namespace.
4
2284
by: z. f. | last post by:
Hi, I'm having an aspx page with a server form. i have a grid with a delete button and below the grid, another area with inputs for inserting new values and an "add" button for submiting the lower area of the form. on the lower area i have validators for validating input.
4
2012
by: z. f. | last post by:
Hi, i stated that this is an advanced question because i have a post from few days ago that i received answers to with suggestions that looked good but did not work, so please if you post a reply make sure your suggestion actually works. like a <asp:button> control have a CausesValidation property that allows it to POST a button command event to the server without causing the page to make validation on form inputs, i need to get the...
4
2546
by: Jim Bancroft | last post by:
Hi everyone, I've been working with ASP.Net for about a month, and in all the samples I've seen the authors know ahead of time how many DropDownLists or Labels they're going to need. My problem is that I don't always know at design time how many (for instance) DropDownLists I'll need. As an example, one of my old asp pages queries a table and loops through the resulting recordset, adding one DropDownList per entry and populating it...
4
2215
by: Satya | last post by:
Hi all, The following code is throwing a run time error "The server tag is not well formed. " <ItemTemplate> <asp:HyperLink Runat="server" ID="lnkFile" NavigateUrl="javascript:OpenImage('<%# DataBinder.Eval(Container.DataItem,"FileName") %>');"><%#
2
1459
by: John Smith | last post by:
I have this DataGrid: <asp:datagrid id="dg1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:TemplateColumn HeaderText="SM"> <ItemTemplate> <asp:Label id="Label2" runat="server" Text='<%# Container.DataItem("SM") %>'> </asp:Label> </ItemTemplate>
5
2224
by: Alex Maghen | last post by:
I frequently find myself wanting to insert some basic client-side JavaScript functions in the page of an ASPX of mine. But I find it so frustrating that I have to actually contruct my JavaScript in C# on the server-side and render it to the client because I can't use the IDs of my controls as they are written in the HTML page itself. Rather, I have to use Control.ClientID to get that ID that I can use in the client-side JS. So my...
3
1340
by: henk | last post by:
Hey, Question, how can i create client-side javascript that refers to a asp.net webcontrol. For example set the focus of a textbox lik this. <asp: TextBox ID="Textbox1" /> (client side) <script javascript> Textbox1.focus();
0
8889
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9179
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9116
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8099
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.