Sub
cbCustomerSearchValue_KeyPress
If
Asc(e.KeyChar) = 13 Then
Retailers = Retailer.LoadRetailersByReference1(cbCustomerSearchValue.Text)
RetailerBindingSource.DataSource = Retailers
If Retailers.Count > 1 Then
cbCustomerSearchValue.MultiColumnComboBoxElement.ShowPopup()
ElseIf Retailers.Count = 1 Then
LoadCustomer(Retailers(0))
tabCustomerInformation.Focus()
End If
End if
End sub
When the user selects a row, I load the information about the customer like this:
Private Sub cbCustomerSearchValue_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbCustomerSearchValue.SelectedValueChanged
If cbCustomerSearchValue.MultiColumnComboBoxElement.IsDroppedDown And cbCustomerSearchValue.SelectedItem IsNot Nothing Then
LoadCustomer(DirectCast(DirectCast(cbCustomerSearchValue.SelectedItem, Telerik.WinControls.UI.GridViewDataRowInfo).DataBoundItem, DataAccessLayer.Retailer))
End If
End Sub
If the search result in just one hit, I load that customer and display information about it.
Here comes my problem:
If the search resulted in more then one hit, I show the drop down list and the user can then select. (This is working)
The problem here is that even though the text inside the drop down box is not the same as the displaymember text on the first row, the first row in the grid is still selected.
Since the row is already selected, the selectedvaluechange event will not fire :(
Is there a way to detect when the actual user clicks on a row (and not when the databind occurs)?
Why is the first row selected when databinding occurs, can I disable this behavior?
In a normal dropdown control no row is selected until the user made it choose.
I think the multicolumndropdown should behave the same :)
Regards
Per
this.villeTableAdapter.Fill(this.logisticsDataSet.Ville);
// TODO: This line of code loads data into the 'logisticsDataSet.Region_2' table. You can move, or remove it, as needed.
this.region_2TableAdapter.Fill(this.logisticsDataSet.Region_2);
// TODO: This line of code loads data into the 'logisticsDataSet.Pays' table. You can move, or remove it, as needed.
this.paysTableAdapter.Fill(this.logisticsDataSet.Pays);
this.radTreeView1.RootRelationDisplayName = "Cont";
this.radTreeView1.DataSource = this.paysBindingSource;
Now my treeView is correctly populated.
My problem is how the change the text displayed in the treeNode because i want that the treeView another column name (and in the future i want to customize the text displayed in the treeNode) ?
Thanks in advance.
I have a GridView into which I load a few rows of data. Behind each row I have more information, which is displayed in a different form when the user clicks on the row. I also have "Previous" and "Next" buttons to navigate in the GridView.
At startup it looks like the first row is selected, it is blue and has a little arrow to the right. But when I click the "Next" button I get radgrid.SelectedRows.Count = 0, and therefore I can't navigate to the next row. If I then click on the first row I get the same result, BUT if I click on one of the other rows I get radgrid.SelectedRows.Count = 1 and everything works fine. I then can click on the first row too, getting the expected result.
Is this a bug, or is it something I'm doing wrong? Is there a way to set which row that is selected, - radgrid.Rows.SelectedIndex = 0 ?
Any help is appreciated.
Regards,
Jill-Connie Lorentsen