Web Forms :: How To Filter PO Item In Invoice Entry And Avoid Duplicate Selection Of PO Item Again

Aug 22, 2010

This is the Grid am using ....

[Code]....

Every thing is working fine ....

Wat i did is in the first header of gridview dropdownlist i have binded the PO Item , so that user can select item n make invoice...

Here the problem is user will click addnewrow button to create new row second row , again user is able to select the same item what he selected in first row of gridview. here how to avoid duplication in the second row .

Say i have four PO item

Item1,Item2,Item3,item4

user may select Item1 in first row , after clicking addnewrow button user will get second row

here again user is able to select Item1 from dropdownlist ... how to avoid duplicate selection

coz the dropdownlist is binded from database using sqldatasource n filter based on user selected PO no.

Duplicate Item selection should be removed until all the four item is selected ...

View 1 Replies


Similar Messages:

Web Forms :: Manual Entry In Dropdownlist On Selecting Particular List Item?

Jan 2, 2011

In my project requirement user wants to enter a manual entry if they can not find an item in the drop down list.

Right now what I am doing is:

I set the dropdown list autopost back true and on selectedchanged event I am hiding the drop down list and showing a text box to enter a manual entry...

This is working perfect and no problems..

but the drop down list needs to change to a text box on only selecting a "unknown" option in the list...all other list items are doing unnecessary post back to the server with no use...

View 4 Replies

Web Forms :: Duplicate Item Appearing In Dropdown?

Apr 20, 2010

I am using following code for filling dropdown

[Code]....

Till here it is working properly, but when I add following line after loop, it added another name. Actually I want to show username selected for logged in username i.e. strFullName

[Code]....

View 2 Replies

Web Forms :: Listbox.Selected - Duplicate Item Error

Nov 4, 2010

I have built one of those 2 listbox things where the items in the left textbox can be selected and moved to the right list box. The items in the list can be thought of as tasks (like Raise Invoice, Call Client, Deliver goods etc) The rules of this are that the item you move to the right box remains in the left box. Reason being, you are allowed to add the same item from the left to right as many times as you like. An example what the list on the right might look like is this.

Raise Invoice
Call Client
Deliver Goods
Installation
Call Client
Finalize Deal

Now I have added the feature to select an item on the right and hit the UP button, to move it up in the list. For example I could select 'Deliver Goods' and hit the up button. (the down button works as expected)

Raise Invoice
Deliver Goods
Call Client
Installation
Call Client
Finalize Deal

If i select the 2nd instance of Call Client and hit the up button,

Raise Invoice
Call Client
Deliver Goods
Installation
Call Client
Finalize Deal

This is what happens.

Raise Invoice
Call Client
Deliver Goods
Installation
Call Client
Finalize Deal

My code that loops though and does the move relies on the item.selected property to find which on I have selected. (obviously)

[Code]....

Despite having the items at the bottom of the list selected, the .Selected property is true on the first instance of the item that happens to have the same .Text and .Value.

View 1 Replies

Web Forms :: Avoid Loading Time While Switching Over From One Menu Item (tab) To Another?

Feb 24, 2011

I have used the following controls in my web page.

1.Menu
2.Multi view
3.view
4.Gridview

But my problem is...whenever i clicks on the menu item it loads particular content individually. I mean if i click on menuitem1 it takes some time to load Gridview1 , after if when i click on menuitem2 again it takes some time to load Gridview2. Is there is any way to load all the menu items content during first time of page load. So that we can avoid loading time while switching over from one menu item(tab) to another.I have used the following code

[Code]....

View 1 Replies

How To Prevent Duplicate Item

Jul 26, 2010

i have a dropdownlist (asp.net control) and a listbox control and a Add button when the user select the item from dropdownlist and click on add button to add to the listbox.

how can i prevent the user from adding duplciate items and alert saying its already in the listbox?

UPDATE:

in my particular scenario, i have a dropdwonlist and adding the item to listbox both are asp.net controls and i am adding the items from code-behind and your solution is pure on client side, is there a way i can read the listbox and compare and alert the message?

View 2 Replies

Web Forms :: Dropdownlist Selection Changes To First Item On Postback

Oct 19, 2010

I have been having some trouble with dropdown lists reverting back to selecting the initial item in the list after a postback once a selection has been made from the dropdown list. I have read up on this and found out that a "if not ispostback then" is required.This works fine when I add in all the items in the dropdown list manually like:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
ddl1.Items.Add("Select...") [code]....

However, I have over 250 items and so it is far more efficient for me to load then in by using part of a multidimensional array which is created from a text file - Definitive database.txt. I have been using the following code to do so:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
'loads the definitive database array[code]...

This loads all the items into the dropdown list perfectly, but now every time a selection is made, it reverts back to the inital item on postback even though i have included the "if not ispostback then" part.

View 3 Replies

Web Forms :: List Box Jumps Back To Top On Selection Of Item (Postback)

May 5, 2010

I have an asp:ListBox which contains a list of countries. Users select one or more countries and then assign them to another list box on the page.

<asp:ListBox id="countrylist" runat="server" SelectionMode="Multiple" AutoPostBack="True" CssClass="inputC" OnSelectedIndexChanged="countrylist_SelectedIndexChanged"></asp:ListBox>

In Internet Explorer, if I scroll down (say to United States) and then click it, the list scrolls back to the top. United States is still selected, if I press the "Assign" button it will appear within the second list box, and if I scroll down I can see that United States is still selected.

However, users are complaining about this, especially since it happens so quickly that they can't select multiple countries.

I tried using smartnavigation and MaintainScrollPosition, but this has had no effect.

<%@ Page Language="C#" smartNavigation="true" MaintainScrollPositionOnPostback="true" AutoEventWireup="true" EnableEventValidation="false" MasterPageFile="MasterPage.master" CodeFile="form.aspx.cs" Inherits="forms_template" %>

This behaviour is not exhibited in Firefox.

View 2 Replies

Forms Data Controls :: How To Filter Item Of Database In Dynamic Rows In GridView

Aug 19, 2010

I have used this gridview in my project nad its working fine.

View 2 Replies

Web Forms :: Changing The Selection Color(blue) For The Items In The List Item?

Mar 3, 2011

Is there a way that we can change the color (which is defaulted to blue) when the items in the list box are selected? If so can you provide me a sample for it?

View 1 Replies

C# - Filter Time From Item Template In Gridview

Aug 11, 2010

I have written the following in my gridview i would like to show only date to the user i did not need time how to format it

<asp:TemplateField>
<EditItemTemplate>
<asp:Label ID="lblPurchasedDate1" runat="server" Text='<%# Eval("purchaseDate") %>'
Width="61px"></asp:Label>
</EditItemTemplate>
<HeaderTemplate>
PurchasedDate
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblPurchasedDate" runat="server" Text='<%# Eval("purchaseDate") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>

View 1 Replies

Drop Down Item Selection In GridView?

Jun 2, 2010

I have insert drop down in Grive view Edit template

[Code]....

Data set acts as source for gridview, how do i select the item in the dropdown that is coming from dataset
e.g if it was a textbox i would fill it this way

[Code]....

How do i do this in drop down.

View 1 Replies

Web Forms :: Redirecting A User Selected Item In A Drop Down List To Another Item?

Feb 10, 2010

I have a list with 2 sorts of items. Items that have actual values (1,2,3,4 etc) and items that are like group headings so all their values are set to 0. If someone decides to select a group heading - which has a value of 0, is it possible to redirect them to my 'Select an item' item which has a value of ""?

If worse comes to worse, I can just reconstruct the entire list, although if possible I'd like to avoid it.

View 4 Replies

Forms Data Controls :: Check If Item Exists In E.item.dataitem?

Oct 27, 2010

I use a ItemDataBound for a repeater.But i use 2 kinds of linq querys to bind it.Some of them has a MerkID, and some doesnt have this item.So its easy i need to do this:

if(e.Item.DataItem.Contains("MerkID"))

{
//Code for linq query 1

} [code]...

So of course the if selection doesnt work, but how can i do that? I already tryed this:

DataRowView drv = (DataRowView)e.Item.DataItem; if (drv.Row.Table.Columns.Contains("MerkID"))

But that doenst work because he cant convert it to a datarowview because its a linq class.So what to do? Right now i use a try and catch, but there are better solutions i guess...

View 8 Replies

Web Forms :: Get Current Item Index Of Repeater Item When Button Is Clicked

Jan 17, 2014

How can I get current viewed itemindex of a repeater item template, have tried a few stuffs i got from google search, but it seems not to work. 

I have items like:

1 text link1
2 text link2
3 text link3
4 text link4

where 1, 2, 3, 4 are the itemindex, i want to be able to get 1 if text link1 is clicked, or 2 if text link two is clicked etc.

Here is my repeater html

View 1 Replies

Web Forms :: System OleDbDataReader Does Not Contain A Definition For Item And No Extension Method Item

Aug 31, 2013

Error 1 'System.Data.OleDb.OleDbDataReader' does not contain a definition for 'Item' and no extension method 'Item' accepting a first argument of type 'System.Data.OleDb.OleDbDataReader' could be found (are you missing a using directive or an assembly reference?) 

public partial class Default2 : System.Web.UI.Page {
System.Data.OleDb.OleDbConnection Con = new System.Data.OleDb.OleDbConnection(System.Web.Configuration.WebConfigurationManager.
ConnectionStrings("MyConnectionString").ConnectionString);
protected void Page_Load(object sender, EventArgs e)

[Code] .....

View 1 Replies

Web Forms :: DropDownList Selected Item Is Lost And Default Item Is Inserted In Database On Button Click

Jul 16, 2012

I bind dropdownlist in my page

protected void Page_Load(object sender, EventArgs e) {
BindDropDownList(DDL1, "city1", "name", "ID");
DDL1.Items.Insert(0, new ListItem("select city", "0"));
}

And SP

LTER procedure [dbo].[city1]
as
begin
select id,Name
from city
end

And design code

 <asp:DropDownList ID="DDL2" runat="server" CssClass="daddsd">
</asp:DropDownList>

And here is imagebutton code that when click on it update data into table

protected void ImageButton_Click1(object sender, ImageClickEventArgs e) {
string data = Server.UrlDecode(Request.QueryString["BehCode2"]);
SqlCommand _cmd = new SqlCommand("insertinfo", _cn);
_cmd.CommandType = CommandType.StoredProcedure;
_cn.Open();

[Code] ....

Here when i click on button it insert all data into table but it didn't insert my selected item from dropdownlist it insert select city that i define in page_load

 DDL1.Items.Insert(0, new ListItem("select city", "0"));

And when i delete this code from page load it insert in table first row of my table it didn't insert my selected item from dropdown list.

View 1 Replies

Forms Data Controls :: Repeater Add Before Every 1st Item, Adding After Every 2nd Item?

Oct 6, 2010

I have a repeater control:

<asp:Repeater ID="rep" DataSourceID="XMLDSCompare" runat="server">
<ItemTemplate>
<h4><%# XPath("title")%></h4>
</ItemTemplate>
</asp:Repeater>

Now if its the first item in the total resultset, I want to add <div> to ItemTemplate control, if its the 2nd item, I want to add </div>

So output would be (not including table tags generated by repeater control):

<div>
title 1
title 2
</div>
<div>
title 3
title 4
</div>
<div>
title 5
title 6
</div>

How would I do this in the ItemDataBound event of repeater control?

View 6 Replies

Forms Data Controls :: Item Always Get One And Only One Last Item Using OnItemDataBound Method?

Nov 7, 2010

[Code]....

here the method OnItemDataBound , look at how it work

[Code]....

problem is the e.Item always get one and only one last item . turn out my listview display many rows but with a consistent content of the last user (in the database record) . How can i resolve this ?? any creative method are accepted , i'm just want to finish this project

View 2 Replies

Web Forms :: Show All Item In Second Cascading DropDownList When Default Item In First One

Aug 12, 2012

I have 2 dropdownlist in my page

1-ddlzone1

2-ddlstore1

What I need is if I select default item i.e. 0 in Zone dropdown I need to show all items in store dropdown. Below is my stored procedure to get the stores

ALTER procedure [dbo].[selectcenter]
@RegionID varchar(5)
as
begin
select ID,Centername
from Shoppingcenter
where RegionID=@RegionID
group by ID,Centername
end

View 1 Replies

Forms Data Controls :: Validating Page With Listview Edit Item And Insert Item Templates Are Both Present

Aug 9, 2010

I have a listview set up in "flow" mode where the existing records are all on an extended page so you can scroll down to any record.

The InsertItem Template is in the first position, making it easy to insert a new record.

And one can scroll down the page to any record, click the edit button and update that record -- nice having everything on one scrollable page.

I am running into a problem with validations. I have validation controls restricting inputs for all the textboxes on the Insert Item template. They work fine. And on Item Inserted I am running a page validation:

Page.Validate()
If Not Page.IsValid Then
e.Cancel = True
End If

which works fine also.

The problem occurs when I scroll down to an existing record, and go to edit it. I have all the same validation constraints on the textboxes for the EditItemTemplate as I have on the InsertItemTemplate. But I cannot successfully do a page validation on updating the record. The code I am using on update is:

Protected Sub LVRentals_ItemUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ListViewUpdateEventArgs) Handles LVRentals.ItemUpdating
Page.Validate()
If Not Page.IsValid Then
e.Cancel = True
End If
End Sub

This results in a Cancel even if there are no validation errors on the InsertItemTemplate because the Page.Validate() seems to be causing the InsertItemTemplate to think its fields should be filled out also.

Here is the code for a typical entry of the InsertItem Template:

[code]....

All the controls in the Edit Item template are part of ValidationGroup "edit1" and those of the InsertItem Template are part of ValidationGroup "edit2"

How can I get around receiving validation errors on the InsertItem Template when I am trying to validate just the EditItemTemplate when both are present on the page?

View 2 Replies

How To Get Selected Text From Select Element On Selection Of Any Item Through JQuery

Mar 3, 2011

i have a select element with few items and the script.

[Code]....

on selection of any item from the dropdownlist how can i get the text selected from dropdown in the javaScript function that i have provided in onchange event handler ?

View 2 Replies

AJAX :: Show Modal Popup On DropDownList Item Selection

May 7, 2015

I have a dropdown list which has states retrieved from a table. I want to have an option to add new states.. I have added a list item NEW in the dropdown. When I click on NEW i should get a pop up to add a new state  and goes in the table.

View 1 Replies

Web Forms :: How To Remove Menu Item Or Sub Item By Value

Sep 20, 2010

I have an asp.net menu in which i have to let some nodes visible or invisible base on some logic.I know i can find value by item but i wnated to FindItemByValue of my asp.net menu.Could it be possible?

View 3 Replies

Web Forms :: How To Add An Item In A Dropdownlist And Modify The Value Of That Item

Jul 10, 2010

I need to add an item in a dropdownlist and also modify the value of that item, but im getting an error : "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"here's my Page load

Dim rt as new OleDbCommand("Select * from Question ", con)
dim rd as OleDbDataReader
rd = rt.ExecuteReader
Dim a as new OleDbCommand("Select Count (*) as C from Question" , con)
[code]...

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved