I have a simple question, I have a datagrid and inside the grid, i have List
box. I am able to render the page with the datagrid and the lisbox values.
Now, my question is how to trap the server side SelectedIndexCh anged event of
the listbox.
Any help in VB.NET would be greatly appreciated.
Thanks 3 1896
Raja:
I assume inside the grid definition you have something like:
<asp:TemplateCo lumn>
<ItemTemplate >
<asp:ListBox
ID="ItemList" Runat="server"
AutoPostBack="T rue"
OnSelectedIndex Changed="DropDo wn_SelectedInde xChanged"/>
</ItemTemplate>
</asp:TemplateCol umn>
The key is setting the AutoPostBack property to true and declaring an
event handler inside the tag. Then add an event handler in the code
behind - the sender parameter will be a reference to the ListBox.
Make sense?
--
Scott http://www.OdeToCode.com/blogs/scott/
On Tue, 15 Feb 2005 11:49:01 -0800, "Raja"
<Ra**@discussio ns.microsoft.co m> wrote: I have a simple question, I have a datagrid and inside the grid, i have List box. I am able to render the page with the datagrid and the lisbox values. Now, my question is how to trap the server side SelectedIndexCh anged event of the listbox.
Any help in VB.NET would be greatly appreciated.
Thanks
Scott,
Thanks for your quick reply. This is very helpful. I have a further
question, hope you will be able to help me.
As I mentioned I have a grid and the gird has dropdown box as a column and i
have one more column that has hyperlink. The NavigateURL for the hyperlink is
to open a new window with a query stirng parameter as the selected value of
the drop down...
here is how it looks like
<asp:TemplateCo lumn>
<ItemTemplate >
<asp:ListBox
ID="ItemList" Runat="server"
AutoPostBack="T rue"
OnSelectedIndex Changed="DropDo wn_SelectedInde xChanged"/>
</ItemTemplate>
</asp:TemplateCol umn>
<asp:TemplateCo lumn>
<ItemTemplate >
<asp:hyperlin k runat='server' id='PocketDetai ls'/asp:hyperlink>
</ItemTemplate>
</asp:TemplateCol umn>
The url for the hyperlink contorl ("PocketDetails ") has to be created
dynamically and with the querysting parameter as the selected value of
dropdown box ("ItemList") .
Please help me.
Thanks
Raja
"Scott Allen" wrote: Raja:
I assume inside the grid definition you have something like:
<asp:TemplateCo lumn> <ItemTemplate > <asp:ListBox ID="ItemList" Runat="server" AutoPostBack="T rue"
OnSelectedIndex Changed="DropDo wn_SelectedInde xChanged"/> </ItemTemplate> </asp:TemplateCol umn>
The key is setting the AutoPostBack property to true and declaring an event handler inside the tag. Then add an event handler in the code behind - the sender parameter will be a reference to the ListBox.
Make sense?
-- Scott http://www.OdeToCode.com/blogs/scott/
On Tue, 15 Feb 2005 11:49:01 -0800, "Raja" <Ra**@discussio ns.microsoft.co m> wrote:
I have a simple question, I have a datagrid and inside the grid, i have List box. I am able to render the page with the datagrid and the lisbox values. Now, my question is how to trap the server side SelectedIndexCh anged event of the listbox.
Any help in VB.NET would be greatly appreciated.
Thanks
Raja:
You can use some data binding syntax to set the hyperlink properties
from your datasource - that's just one possible solution.
Perhaps this might give you a tip: http://odetocode.com/Articles/278.aspx
HTH,
--
Scott http://www.OdeToCode.com/blogs/scott/
On Wed, 16 Feb 2005 07:31:12 -0800, "Raja"
<Ra**@discussio ns.microsoft.co m> wrote: Scott, Thanks for your quick reply. This is very helpful. I have a further question, hope you will be able to help me.
As I mentioned I have a grid and the gird has dropdown box as a column and i have one more column that has hyperlink. The NavigateURL for the hyperlink is to open a new window with a query stirng parameter as the selected value of the drop down...
here is how it looks like
<asp:TemplateC olumn> <ItemTemplate > <asp:ListBox ID="ItemList" Runat="server" AutoPostBack="T rue" OnSelectedInde xChanged="DropD own_SelectedInd exChanged"/> </ItemTemplate> </asp:TemplateCol umn> <asp:TemplateC olumn> <ItemTemplate > <asp:hyperlin k runat='server' id='PocketDetai ls'/asp:hyperlink> </ItemTemplate> </asp:TemplateCol umn>
The url for the hyperlink contorl ("PocketDetails ") has to be created dynamically and with the querysting parameter as the selected value of dropdown box ("ItemList") .
Please help me.
Thanks Raja
"Scott Allen" wrote:
Raja:
I assume inside the grid definition you have something like:
<asp:TemplateCo lumn> <ItemTemplate > <asp:ListBox ID="ItemList" Runat="server" AutoPostBack="T rue"
OnSelectedIndex Changed="DropDo wn_SelectedInde xChanged"/> </ItemTemplate> </asp:TemplateCol umn>
The key is setting the AutoPostBack property to true and declaring an event handler inside the tag. Then add an event handler in the code behind - the sender parameter will be a reference to the ListBox.
Make sense?
-- Scott http://www.OdeToCode.com/blogs/scott/
On Tue, 15 Feb 2005 11:49:01 -0800, "Raja" <Ra**@discussio ns.microsoft.co m> wrote:
>I have a simple question, I have a datagrid and inside the grid, i have List >box. I am able to render the page with the datagrid and the lisbox values. >Now, my question is how to trap the server side SelectedIndexCh anged event of >the listbox. > >Any help in VB.NET would be greatly appreciated. > >Thanks
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: ericm1155 |
last post by:
I am trying to display some information from a database in a form that
displays one record per line. When the user clicks anywhere on a line, that
record is highlighted and selected, and my program will respond to that. The
problem is that with a listbox control (which is what it sounds like I need),
I can't get the information to format at all. \t-Tabs skew the data
unpredicatably - it leaves some words closer together on some lines than...
|
by: Chris Leuty |
last post by:
I am populating a multiselect Listbox from a dataset, with the content of
the listbox filled by one table, and the selections determined from another
table. So far, I have been keeping the dataset a denormalized mirror of the
database, but I'm not having much luck getting the selection logic down (I
haven't found a 'hook' where I can access the listbox object as an object to
set the listitem's selected property before it gets rendered)..
...
|
by: Lie |
last post by:
Hi all,
I have problem in getting selectedindex of multiple listbox selection in a
datagrid. I have a listbox with multiple selection mode inside datagrid. In
Edit mode, I need to get back all selected items of that listbox and display
it.
can anyone help?
Thanks
|
by: Sosh |
last post by:
Hi,
I'm having a bit of a job getting a handle on a ListBox that i've
placed in one column of the footer in a DataGrid.
Here's what I've tried so far:
- Declaring a protected listbox (with the same id as the aspx) in code
behind, and accessing that directly.
|
by: Rosanne |
last post by:
I have a menu written in javascript. I include that menu on an asp
page. The aspx page contains both a listbox and a datagrid. There i
one drop down menu that overlaps the place where the listbox is. Whe
the user hovers over the drop down menu, the listbox hides the botto
options on the menu. However, the menu also overlaps the place wher
the datagrid is, but the datagrid does not hide the menu - the men
appears over the datagrid as...
| |
by: |
last post by:
Greets All,
Question on data in datagrid /listbox and looping?
I’m trying to decide the best way to write this code.
1 would like the user to make several selections from one listbox/combo box that would
Populate another Listbox/datagrid. Then it would cycle through the selections made in the populated listbox/datagrid and do some calculations. The calculations made would have to add the first two numbers in the populated...
|
by: |
last post by:
Greets All,
Question on data in datagrid /listbox and looping?
I’m trying to decide the best way to write this code.
1 would like the user to make several selections from one listbox/combo box that would
Populate another Listbox/datagrid. Then it would cycle through the selections made in the populated listbox/datagrid and do some calculations. The calculations made would have to add the first two numbers in the populated...
|
by: zdrakec |
last post by:
Hello all:
Clearly, I'm not getting it! Here is the scenario:
On a web page, I have two list boxen and a text box. The first listbox
is populated at page load time (if it is not a postback). This listbox
has AutoPostback = True. When the user selects an item from this list,
the second listbox is populated with more items relevant to this
selection. I am using an SQLDataSource web control for this. These
items are headers. I want, when...
|
by: PeteOlcott |
last post by:
http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/grid/tests/test_change_structure.html
I would like to completely understand how GUI controls such as this
one are constructed. In the ideal case I would like to see all of the
source code for a complete working example of a ListBox of CheckBoxes.
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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: 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: 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();...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |