I have the following on my page... a link button that will send the command
name "use" to the command handler and a grid view with the following columns
0 - Template column - just a checkbox (asp.net control)
1 - Bound column - DisplayName from data table
the checkbox is just a template i made by placeing an asp.net control into
the item template
when I check items on the grid then click the link and execute the following
code in it
Protected Sub ToolbarCommand( ByVal sender As Object, ByVal e As
System.Web.UI.W ebControls.Comm andEventArgs) Handles
lnkUseRecipient s.Command, lnkCancel.Comma nd
Select Case e.CommandName.T rim.ToCharArray
Case "USE"
For Each _gvRow As GridViewRow In Me.GridView1.Ro ws
' perform the selected command on all checked messages
If DirectCast(_gvR ow.Cells(0).Con trols(1), CheckBox).Check ed Then
'do something here
End If
Next
end sub
when I run through it, all the items come back as unchecked... but the
strange thing... similar method on another page doing it the same way and it
comes back with items checked! why would one post back the checked items and
the other not? what should I look for? any suggestions on how to help?
thanks! 2 2804
I should probably add the grid is databound to a typed collection that
inherited from the collectionbase on the page that doesnt work, and the page
that does work is tied to a datatable
"Smokey Grindle" <no********@don tspam.net> wrote in message
news:eM******** ******@TK2MSFTN GP02.phx.gbl... I have the following on my page... a link button that will send the command name "use" to the command handler and a grid view with the following columns
0 - Template column - just a checkbox (asp.net control) 1 - Bound column - DisplayName from data table
the checkbox is just a template i made by placeing an asp.net control into the item template
when I check items on the grid then click the link and execute the following code in it
Protected Sub ToolbarCommand( ByVal sender As Object, ByVal e As System.Web.UI.W ebControls.Comm andEventArgs) Handles lnkUseRecipient s.Command, lnkCancel.Comma nd
Select Case e.CommandName.T rim.ToCharArray Case "USE"
For Each _gvRow As GridViewRow In Me.GridView1.Ro ws
' perform the selected command on all checked messages
If DirectCast(_gvR ow.Cells(0).Con trols(1), CheckBox).Check ed Then
'do something here
End If
Next
end sub
when I run through it, all the items come back as unchecked... but the strange thing... similar method on another page doing it the same way and it comes back with items checked! why would one post back the checked items and the other not? what should I look for? any suggestions on how to help? thanks!
nevermind im stupid today.. i was rebinding on postback in page load.. which
was clearing the data..
"Smokey Grindle" <no********@don tspam.net> wrote in message
news:uT******** *****@TK2MSFTNG P05.phx.gbl... I should probably add the grid is databound to a typed collection that inherited from the collectionbase on the page that doesnt work, and the page that does work is tied to a datatable
"Smokey Grindle" <no********@don tspam.net> wrote in message news:eM******** ******@TK2MSFTN GP02.phx.gbl...I have the following on my page... a link button that will send the command name "use" to the command handler and a grid view with the following columns
0 - Template column - just a checkbox (asp.net control) 1 - Bound column - DisplayName from data table
the checkbox is just a template i made by placeing an asp.net control into the item template
when I check items on the grid then click the link and execute the following code in it
Protected Sub ToolbarCommand( ByVal sender As Object, ByVal e As System.Web.UI.W ebControls.Comm andEventArgs) Handles lnkUseRecipient s.Command, lnkCancel.Comma nd
Select Case e.CommandName.T rim.ToCharArray Case "USE"
For Each _gvRow As GridViewRow In Me.GridView1.Ro ws
' perform the selected command on all checked messages
If DirectCast(_gvR ow.Cells(0).Con trols(1), CheckBox).Check ed Then
'do something here
End If
Next
end sub
when I run through it, all the items come back as unchecked... but the strange thing... similar method on another page doing it the same way and it comes back with items checked! why would one post back the checked items and the other not? what should I look for? any suggestions on how to help? thanks!
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: William Gower |
last post by:
I need to develop a datagrid that uses columns from a table. In addition I
need two columns (checkboxes) that the user will use to indicate that this
record can be closed later. The checkboxed column is not a field in the
table. It is just for the purposes of the Datagrid and I do not need to
store whether it was checked or not. Do I use a Template Column for this?
|
by: Chris |
last post by:
I've searched, reviewed, and attempted dozens of code ideas on the subject. I
can't seem to get something that seems so simple to work. To highlight a row
in a datagrid based on another value in that row.
I have a datagrid using Template and Item Columns, i.e.:
<asp:TemplateColumn HeaderText="CA Date Req"
HeaderStyle-CssClass="gridqtext" ItemStyle-CssClass="gridtext">
<ItemTemplate>
<asp:Label ID="lblcadatereq" CssClass="gridtext"...
|
by: Shahid Saleem |
last post by:
Dear Members
I am using a data list , in the item template i have used a data grid
with template column (CheckBox) and a button named sumbit.
I want to get the data grid selected rows(Makred checked) upon click of
sumbit button.
I am looking where to write code for sumbission button when it is being
used in item template??
|
by: Abhishek |
last post by:
I am creating a Datagrid at runtime and I have to create all the columns of
grid at runtime... I am facing problem in the item template column. Here I
want to place more than one control... For example Suppose there is a
template column tc and i want to place two drop downlist in this tc say
DrpList1 and DrpList2... Can anyone provide me any idea how to do this... I
am getting many examples of adding items to the item template column by...
|
by: Charleees |
last post by:
Hi all,
I have a DataGrid with Template Columns.....
There are LAbels,Linkbuttons in the Single Row..
I have to set the Constant Column width for those Template Columns in
Grid...
Wat actually happens is... when the Text size is too big... the column
| |
by: Gunawan |
last post by:
Hi,
I could add a boundcolumn to gridview using this
BoundColumn bc = new BoundColumn();
bc.DataField = "ProductsName";
bc.HeaderText = "Product";
gridview1.columns.add(bc);
What I would like to ask, how can I perform this with TemplateColumn?
I have a problem to bound template column to any object such as dropdownlist
|
by: Shaileshsharma |
last post by:
Hi,
I am using Grid View Template field(Check Box) for delete a row, but i need a message box(OK/Cancle) should display before deleting the row.My C# Code like this for deleting the row when we click on check box of grid view.
protected void CheckBox2_CheckedChanged(object sender, EventArgs e)
{
CheckBox chk = (CheckBox)sender;
GridViewRow row = (GridViewRow)chk.NamingContainer;
if (chk.Checked ==...
|
by: =?Utf-8?B?UGF1bA==?= |
last post by:
Hi I have a generic list of data
list <typelistcategory;
listcategory = new list <type>;
I also have a dropdown box that I have put into a template column of a
gridview.
I was able to populate the dropdown box ok when it was outside of the gridview
for (int i = 0; i <= listcategory.Count - 1; i++)
{
ddl.Items.Add(listcategory.Description);
|
by: rogerford |
last post by:
I have a grid which i bind with values from Database. I have events to edit and update the grid. I am not using SqlDatasource to connect to DB. Rather i am doing the updating of the grid Programmatically.
I have 3 columns, LID(item template column) ,LVal (Edit Item template column) and Edit link
My Question:
1) My EditITemTemplate column has a textbox txt_Lval which does not show up on the page load. But if click on edit link that...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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...
| |
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,...
|
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |