I am using a simple DropDownList where I have 6 listItems hardcoded. Item 0 only as text and does not have a value. When listItems 1-3 are selected, I am able to get the correct value in code behind but when listItems 4 and 5 are selected the value obtained in code behind is for listItem 1. I saw some posts talking about how I should use "Not Page.IsPostBack" to bind my control only on page load. But I don't this is my case. I have tried to do a databind for the control in the "Not Page.IsPostBack" but I get the same result. I also added a OnDataBinding event to my control that fires an alert. The alert only shows when the page is loaded and not on form submission. Can someone please help me to get to correct values for the 4th and 5th items and help me to understand what is going on here?
Thank you much,
Billy
I got it! I wanted to use the same value for 3 of my listItems (1, 4 and 5). When I select item 4 or 5, the code behind used the first listItem that had same value (listItem 1) instead of the actual selected item. Once I used unique values for the listItems in question, I got the functionality that I was looking for. Now I just have to do a little extra processing in code behind to set the value that I want.
Related
I want to add the items checked in the checklistbox into different textboxes.
Like checklistbox item 1 checked must be added to textbox 1.
Then the next item checked that is checklistbox item 2 must be added to textbox 2. I want to do this for 4 item.
I am new to this language. I am trying to get the desired result but I am just not getting the code right.
Please help me.
I'm a bit of a newbie and my question probably has a simple answer... I have searched this site and Google, but haven't found an answer yet? JaredPar's answer to the above question seems to be the answer to my current need, but I pasted his code into my program and it gives me the following problem:
SelectedIndex is not a member of ListView.
This is the only code I have found so far to delete the same selected item from more than one ListView.
I am inserting node text from a Treeview into a ListView and a DataGridView(DGV). When the user inserts the wrong item from the Treeview and decides to delete it both from the Listview and the DGV, the user selects the item from the current list in Listview and clicks the Delete button. This should delete the same item in both the Listview and the DGV to maintain both lists updated. The Listview is used for a visual list during user selection of items by clicking on Treeview nodes. The DGV is used for filtering a saved list of all the items introduced by user in this way.
I was using the following code until I came across the code by JaredPar under the above title, but this only removes an item from Listview. JaredPar's code appears to remove the selected item from 2 Listviews:
For i As Integer = ListView1.SelectedItems.Count - 1 To 0 Step -1
ListView1.SelectedItems(i).Remove()
Next
I hope my question is understandable and that someone can help me with this to be able to learn from your examples! Thanks for any help!
I have a Devexpress Data Grid with a number of rows loaded.
The following properties are set:
MultiSelectNode=CheckBoxRowSelect
MultiSelect=True
I have a function that iterates through all the Rows and checks, gridview1.IsRowSelected(x) = True.
However the problem is, that even with the checkbox selected is checked it never shows as true.
The following code returns 0
Debug.Print(GridView1.GetSelectedRows().Count)
Is there an easy way to check if the checkbox is checked?
Thanks
the following piece has been working for me in various parts of my app:
First specify the key field name which your datasource collection uses:
<dvx:ASPxGridView ID="xgvGrid" runat="server"
KeyFieldName="ID" ... >
...
</dvx:ASPxGridView>
Then access selected rows IDs by:
...
List<object> values = xgvGrid.GetSelectedFieldValues("ID");...
You can obtain the selected row's count by calling values.Count afterwards.
HTH
Upon closer examination of the code a refresh method was being called which interfered with the grid .getselectedrowsmethod.
Right now I have such form:
The aim, that I'm trying to reach, is to open another form based on block_id value by pressing button. And it works. But block_id value in textblock should be based on three other values in the form: N_table, target_table and source_table. In the attached picture can be seen block_id's textblock form options. Source values for that textblock is query with name s2, and I tried to limit block_id value by setting filter here this way:
([s2].[N_table]=[Form1].[Список0]) AND
([s2].[target_table]=[Form1].[Список2]) AND
([s2].[source_table]=[Form1].[Список4])
There s2 is the query name, Form1 is the name of current form, Список0 and so on is the just list of values for first 3 textboxes. However that doesn't work at all. So block_id is independent. That is wrong here and how it can be fixed?
PS I'm really sorry for not english language in the attached picture, I can't change the language. And I tried to deal with the problem by using Event Processing macros but failed.
I can't read your language, but it looks if the FilterOnLoad property is set to No. Change it to yes, then it should work.
I ' ve a combobox with too long multiple Items . There is any method to set a horizontal scroll in combobox or set a multiline properties for each item ?
Hi Mattia,
There are a couple of methods that are usable as well as effective for this problem you are having, here is the concept that I've created that you may implement in your project;
Original text: C:\path1\path2\path3\path4\file.exe
Combo Box text: C:\path1\p...file.txt
To do this you will 1st have to specify how many characters you want to shown in the start of the text (1st 5 or so) then you must specify how much you would like to leave off at the end (last 6 or so).
I realize this causes a problem, "I wont be able to see the full path!", however adding a 2nd form or a msgbox to display the full text which should initiate the 1st 2-4 secs of display time, this should not be a challenge nor a problem and will make you look like a Pro!
I hope this helped you with your problem or motivated you to go over and beyond!