473,387 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Binded DropDown list

Hi
I'm using a datagrid with a dropdown list in it. The dropdown list is filled
with values from SQL database, it's autopostback property is set to true and
when I select another item in it, the SelectedIndexChanged event fires
properly, but I can't the index or value of the selected item. SelectedValue
and SelectedItem is Nothing, Request.Params("DropDown1") is empty as well.
Thanks for your help!

Jure
Nov 17 '05 #1
4 3338
Please post some code snippet.
Probably you fill dropdown every time, use IsPostBack property to fill it
only first time you enter the page.
Also check if EnableViewState of dropdown and page is set to true.
"Mira Vizjak" <mi**********@guest.arnes.si> wrote in message
news:bf**********@planja.arnes.si...
Hi
I'm using a datagrid with a dropdown list in it. The dropdown list is filled with values from SQL database, it's autopostback property is set to true and when I select another item in it, the SelectedIndexChanged event fires
properly, but I can't the index or value of the selected item. SelectedValue and SelectedItem is Nothing, Request.Params("DropDown1") is empty as well.
Thanks for your help!

Jure

Nov 17 '05 #2
Sorry, can not see any connection between refill dropdown and empty Datagrid
???
Please explain.

"Mira Vizjak" <mi**********@guest.arnes.si> wrote in message
news:bf**********@planja.arnes.si...
Yes, I do fill drop down every time on PageLoad, otherwise the datagrid is
empty on postback.

Nov 17 '05 #3
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Security.IsInRoles("Admins") = False Then
Response.Redirect("default.aspx")
End If
If Page.IsPostBack=False then
BindGrid()
End If
End Sub
In this case when I select an item from ddl control the datagrid on the page
posted back is empty.

If Security.IsInRoles("Admins") = False Then
Response.Redirect("default.aspx")
End If
BindGrid()
End Sub
In this case when I select an item from ddl control the datagrid on the page
posted back is full.
Nov 17 '05 #4
I can't see from code you post where do you fill the dropdown.
Fill it once when Not IsPostBack.

"Mira Vizjak" <mi**********@guest.arnes.si> wrote in message
news:bf**********@planja.arnes.si...
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Security.IsInRoles("Admins") = False Then
Response.Redirect("default.aspx")
End If
If Page.IsPostBack=False then
BindGrid()
End If
End Sub
In this case when I select an item from ddl control the datagrid on the page posted back is empty.

If Security.IsInRoles("Admins") = False Then
Response.Redirect("default.aspx")
End If
BindGrid()
End Sub
In this case when I select an item from ddl control the datagrid on the page posted back is full.

Nov 17 '05 #5

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

Similar topics

1
by: Joseph Barron | last post by:
Here is a SIMPLE problem that I'm trying to solve. It works in Netscape 6.2, but IE6 gives ""No such interface supported." Below are page1.htm and page2.htm . In page1.htm, there are two...
2
by: SammyBar | last post by:
Hi, I'm trying to bind a custom collection class to a data grid, following the guidelines from the article http://msdn.microsoft.com/msdnmag/issues/05/08/CollectionsandDataBinding/default.aspx....
3
by: charliewest | last post by:
I have binded a dropdownlist control to a data view. I am trying to add a listitem to this already binded control, however, i cannot figure this out. My code is: // code to create data view...
6
by: Mark | last post by:
I have two dropdown lists. Both have autopostback set to true. In both dropdowns, when you select an item from the list, it redirects to the Value property of the dropdown. Nothing fancy. ...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
5
by: jung_h_park | last post by:
From: jung_h_park@yahoo.com Newsgroups: microsoft.public.dotnet.framework.aspnet Subject: Dropdown List not retaining its SelectedValue Date: Mon, 26 Jun 2006 21:02:57 -0700 Hello, My...
3
by: er1 | last post by:
Hi all, I have created a double dropdown list. Based on the first list selection, second list populates (this works fine). I have a submit button, which when clicked should run a select query...
3
by: fish919 | last post by:
Hello All, I am creating a date base in access. I want to create a dropdown list box that is connected to another dropdown list box. You start with a dropdown list that has 5 choices and each of...
5
by: abhi3211 | last post by:
i am using java inside java script page. in that page i want to use two dropdown list. in first dropdown list i am getting data from ms-access database. in second dropdown list i want to get data...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
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,...

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.