private int selectedIndex; | |
public TEST() | |
{ | |
InitializeComponent(); | |
} | |
private void radListBox1_SelectedIndexChanged(object sender, EventArgs e) | |
{ | |
int newIndex = radListBox1.SelectedIndex; | |
if (newIndex == selectedIndex) | |
{ | |
DeselectAllElements(); | |
} | |
else | |
{ | |
selectedIndex = newIndex; | |
} | |
} | |
public void DeselectAllElements() | |
{ | |
radListBox1.ClearSelected(); | |
radListBox1.SelectedIndex = -1; | |
selectedIndex = -1; | |
} | |
private void TEST_Load(object sender, EventArgs e) | |
{ | |
string[] list = "blah1,blah2,blah4,blah5,blah6".Split(','); | |
radListBox1.DataSource = list; | |
} |
foreach
(ChartSeries collection in chart.Series){
foreach (ChartSeriesItem item in collection.Items
{
item.ActiveRegion.Click += new RegionClickEventHandler(ActiveRegion_Click);
}
}
protected void ActiveRegion_Click(object sender)
{
ChartSeriesItem item = (ChartSeriesItem)sender;
item.ActiveRegion.Tooltip = item.Parent.Name;
//MessageBox.Show(item.Parent.Name);
}
error:Error 212 No overload for 'ActiveRegion_Click' matches delegate 'Telerik.Charting.RegionClickEventHandler'
In my solution I had RadControls 2007 and I can drag an item from a RadList box, to a RadTextbox
After the upgrade to RadControls 2008 Q2 – the behaviour is a bit funny...
If I use the MouseDown event
private void lstAlertTokens_MouseEnter(object sender, MouseEventArgs e)
{
if (lstAlertTokens.SelectedIndex >= 0)
{
string text = lstAlertTokens.Text;
lstAlertTokens.DoDragDrop(text, DragDropEffects.Copy);
}
}
The Drag and drops works, but when I click on items in the list, they are not selected (highlighted), I must use the up/down keyboard keys to first select the item I want, before I drag and drop it.
If I use the mouseUp event
The item selection works now (gets highlighted) when I click the mouse , but the DragDrop effect icon is missing.. So the drag and drop works, but you don’t see the DragDropEffects.Copy effect.
Any ideas?