473,671 Members | 2,229 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Checkbox in dataRepeater

I have dataRepeater with itemtemlate:
<ItemTemplate >
<tr>
<td><%# DataBinder.Eval (Container.Data Item,"adv_name" ) %></td>
<td><%# DataBinder.Eval (Container.Data Item,"adv_start ") %></td>
<td><%# DataBinder.Eval (Container.Data Item,"adv_end") %></td>
<td align=center>
<asp:CheckBox Runat=server ID='<%#
DataBinder.Eval (Container.Data Item,"adv_ID") %>'></asp:CheckBox>
</td>
</tr>
</ItemTemplate>
This doesn't work. I can't dynamically set the ID of an ASP.NET CheckBox.
I don't know why, it would be much easier.

But by the book, I can handle the OnItemDataBound event and create the
checkbox dynamically, set the ID property, and insert the
control to the Repeater.

How can I do that? Can I pass the
DataBinder.Eval (Container.Data Item,"adv_ID") to the OnItemDataBound event? I
need this value because it represents the ID property of my checkBox
control.

Any example?

At the end, when user clicks button, I must read the clicked checkboxes.

Thank you,
Simon
Nov 18 '05 #1
3 5574
I'm not 100% sure what you are doing, so I can think of a couple solutions,
but the quickest would be to use a hidden field

<asp:checkbox id="add" runat="server" />
<input type="hidden" id="adv_id" runat="server" value='<%#
DataBinder.Eval (Container.Data Item,"adv_ID") %>' />

you can then see if "add" is checked, and if so get the value from 'adv_id'

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"simon" <si*********@st ud-moderna.si> wrote in message
news:%2******** **********@TK2M SFTNGP09.phx.gb l...
I have dataRepeater with itemtemlate:
<ItemTemplate >
<tr>
<td><%# DataBinder.Eval (Container.Data Item,"adv_name" ) %></td>
<td><%# DataBinder.Eval (Container.Data Item,"adv_start ") %></td>
<td><%# DataBinder.Eval (Container.Data Item,"adv_end") %></td>
<td align=center>
<asp:CheckBox Runat=server ID='<%#
DataBinder.Eval (Container.Data Item,"adv_ID") %>'></asp:CheckBox>
</td>
</tr>
</ItemTemplate>
This doesn't work. I can't dynamically set the ID of an ASP.NET CheckBox.
I don't know why, it would be much easier.

But by the book, I can handle the OnItemDataBound event and create the
checkbox dynamically, set the ID property, and insert the
control to the Repeater.

How can I do that? Can I pass the
DataBinder.Eval (Container.Data Item,"adv_ID") to the OnItemDataBound event? I need this value because it represents the ID property of my checkBox
control.

Any example?

At the end, when user clicks button, I must read the clicked checkboxes.

Thank you,
Simon

Nov 18 '05 #2
Hi,

I know for the hidden field. That is one way.

Do you have solution where you set the id of the checkbox dynamically?
Or any other solution?

Thank you,
Simon
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:es******** ******@TK2MSFTN GP15.phx.gbl...
I'm not 100% sure what you are doing, so I can think of a couple
solutions,
but the quickest would be to use a hidden field

<asp:checkbox id="add" runat="server" />
<input type="hidden" id="adv_id" runat="server" value='<%#
DataBinder.Eval (Container.Data Item,"adv_ID") %>' />

you can then see if "add" is checked, and if so get the value from
'adv_id'

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"simon" <si*********@st ud-moderna.si> wrote in message
news:%2******** **********@TK2M SFTNGP09.phx.gb l...
I have dataRepeater with itemtemlate:
<ItemTemplate >
<tr>
<td><%# DataBinder.Eval (Container.Data Item,"adv_name" ) %></td>
<td><%# DataBinder.Eval (Container.Data Item,"adv_start ") %></td>
<td><%# DataBinder.Eval (Container.Data Item,"adv_end") %></td>
<td align=center>
<asp:CheckBox Runat=server ID='<%#
DataBinder.Eval (Container.Data Item,"adv_ID") %>'></asp:CheckBox>
</td>
</tr>
</ItemTemplate>
This doesn't work. I can't dynamically set the ID of an ASP.NET CheckBox.
I don't know why, it would be much easier.

But by the book, I can handle the OnItemDataBound event and create the
checkbox dynamically, set the ID property, and insert the
control to the Repeater.

How can I do that? Can I pass the
DataBinder.Eval (Container.Data Item,"adv_ID") to the OnItemDataBound
event?

I
need this value because it represents the ID property of my checkBox
control.

Any example?

At the end, when user clicks button, I must read the clicked checkboxes.

Thank you,
Simon


Nov 18 '05 #3
Only using OnItemDataBound and creating it dynamically. It's a timing
issue. The controls are created before data is bound...but you need the id
to create the control, so you can't set the id via a bind...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"simon" <si*********@st ud-moderna.si> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
Hi,

I know for the hidden field. That is one way.

Do you have solution where you set the id of the checkbox dynamically?
Or any other solution?

Thank you,
Simon
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:es******** ******@TK2MSFTN GP15.phx.gbl...
I'm not 100% sure what you are doing, so I can think of a couple
solutions,
but the quickest would be to use a hidden field

<asp:checkbox id="add" runat="server" />
<input type="hidden" id="adv_id" runat="server" value='<%#
DataBinder.Eval (Container.Data Item,"adv_ID") %>' />

you can then see if "add" is checked, and if so get the value from
'adv_id'

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"simon" <si*********@st ud-moderna.si> wrote in message
news:%2******** **********@TK2M SFTNGP09.phx.gb l...
I have dataRepeater with itemtemlate:
<ItemTemplate >
<tr>
<td><%# DataBinder.Eval (Container.Data Item,"adv_name" ) %></td>
<td><%# DataBinder.Eval (Container.Data Item,"adv_start ") %></td>
<td><%# DataBinder.Eval (Container.Data Item,"adv_end") %></td>
<td align=center>
<asp:CheckBox Runat=server ID='<%#
DataBinder.Eval (Container.Data Item,"adv_ID") %>'></asp:CheckBox>
</td>
</tr>
</ItemTemplate>
This doesn't work. I can't dynamically set the ID of an ASP.NET CheckBox. I don't know why, it would be much easier.

But by the book, I can handle the OnItemDataBound event and create the
checkbox dynamically, set the ID property, and insert the
control to the Repeater.

How can I do that? Can I pass the
DataBinder.Eval (Container.Data Item,"adv_ID") to the OnItemDataBound
event?

I
need this value because it represents the ID property of my checkBox
control.

Any example?

At the end, when user clicks button, I must read the clicked checkboxes.
Thank you,
Simon



Nov 18 '05 #4

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

Similar topics

3
436
by: Stephen | last post by:
Hi, I have a quick question. I am displaying all the orders that are active. I am making use of a datarepeater with checkboxes to display data and a submit button to insert into the database. suppose i want to make the orders inactive using the checkboxes and click on the submit button should update the database. How do I capture the event such that only those check boxes that have been
2
8933
by: muhamad | last post by:
Hi, How can I use the DataRepeater in CSharp , this control exists in VB6 ,i never used it . I want to insert into the DataRepeater TextBoxs that will show all the time data from the database . Does anyone have an example or direction ?
3
3358
by: | last post by:
Hi, NG! Is there any updated version (.Net) of the Datarepeater control or do I have to use the old (VS6.0) version? Thanks. pax
0
1087
by: simon | last post by:
I have datarepeater with checkBox: <ItemTemplate> <tr> <td><%# DataBinder.Eval(Container.DataItem,"adv_name") %></td> <td><%# DataBinder.Eval(Container.DataItem,"adv_start") %></td> <td><%# DataBinder.Eval(Container.DataItem,"adv_end") %></td> <td align="center"> <asp:CheckBox Runat="server" ID='chkPList'></asp:CheckBox> </td> </tr>
1
1137
by: jose | last post by:
when insert a checkbox in a datarepeater throw this error: Specified cast is not valid.
2
2056
by: Neven Klofutar | last post by:
Hi, How can I bind ArrayList of my object to DataRepeater ? I have 2 classes: public class Movie { private String _Name = ""; private Double _Price = 0;
1
1541
by: Chris Leffer | last post by:
Hi. I have a DataRepeater that is filled with the results of a query based on four criteria fields. If one of these criterias is informed, I don't need to display a certain column in my DataRepeater. I can do that using an If expression on the HTML to conditionally show the column, but is it possible to do that using code-behind only? Regards, Chris Leffer
1
2534
by: =?Utf-8?B?QW1qYWQ=?= | last post by:
Hi i have datarepeater in which i have textboxes, how to create txtCustID_TextChanged event in datarepeater like simple textbox its easy double click it and it create automatically the event but in data repeater we have multiple textbox and cannot directly create event handler for that textbox has repeated several time.
2
2165
by: Tony K | last post by:
I downloaded the new VB PowerPack 3.0 and began using the DataRepeater. I have 2 DateTimePickers, current and future. When I add a new item, to the datarepeater, I want to automatically add 1 year to the future DateTimePicker. The DataRepeater contains fields from the Service table of my DataSet. Here is my code. Try Me.DataRepeater1.AddNew()
0
8476
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...
1
8598
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
7433
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...
1
6223
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5695
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4224
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
4406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1809
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.