0

Save value from the combobox for the index that will be changed.

For e.g: If I have 5 items listed and 1st one is selected and when I change index to suppose 4th one, I need to save the value of 1st listed item at time of index being changed and next time if I select 2nd item on the list it needs to save value for 4th one at time of index change.

I need to pass that value for batch name in the below listed stored procedure every time index is changed so that previous selected index can be unlocked.

cmd.CommandType = CommandType.StoredProcedure;
                    cmd.CommandText = "usp_CAMR_UnlockedBatchName";
                    cmd.Parameters.AddWithValue("@Batch_Name", temp);
                    cmd.Parameters.AddWithValue("@lst_mod_userid", Environment.UserName);
3
Contributors
3
Replies
8
Views
1 Year
Discussion Span
Last Post by Suzie999
0

SelectedIndexChanged event of combobox is unable to help you as if you try to get the SelectedText value in a SelectedIndexChanged or SelectedValueChanged event handler, the property returns an empty string. This is because, at the time of these events, the previous SelectedText value has been cleared and the new value has not yet been set.

0

Keep track of "SelectedIndex" property in "SelectedIndexChanged" event handler.

Edited by Suzie999

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.