This is a migrated thread and some comments may be shown as answers.

Help about event in MultiColumCombobox

3 Answers 61 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
Exclamation
Top achievements
Rank 1
Exclamation asked on 26 Jul 2012, 03:00 AM
Hi, Telerik Team .
My issue is i want to call my method do something when i click one row in EditorControl of MulticolumnComboBox, but i can't use SelectedIndexChange because if Index not change then event does't catch.
I try override method OnMouseUp of MultiColumnComboGridBehavior but this event also catch if i click the scrollBar in EditorControl. You can help me ! anyway, one event that On click one row in editor and dose not run when i click ScrollBar .
Thanks for answers

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 30 Jul 2012, 08:26 AM
Hi Thanh, 

Thank you for writing.

The easiest approach for this case is to subscribe to the MouseDown event of the EditorControl and check if the clicked object is GridCellElement:
void EditorControl_MouseDown(object sender, MouseEventArgs e)
       {
           GridCellElement cellElement = radMultiColumnComboBox1.EditorControl.ElementTree.GetElementAtPoint(e.Location) as GridCellElement;
           if (cellElement != null)
           {
               Console.WriteLine("You have clicked a cell");
           }
       }

I hope that the provided information addresses your question.

All the best,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Exclamation
Top achievements
Rank 1
answered on 02 Aug 2012, 08:40 AM
Thanks Stefan. It was help  me for fix problem.

But when i select a row in RadGridview ,on cell that i selected appear a hight light (you can see my attach picture). You can help me remove it or set for it's border width = 0?

Thanks
0
Accepted
Stefan
Telerik team
answered on 06 Aug 2012, 12:45 PM
Hi Thanh,

Thank you for writing back.

Here is how to remove the formatting of the current and the selected row and cell and set the colors back to the one from the ControlDefault theme:
void EditorControl_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
    if (e.Row.IsSelected || e.Row.IsCurrent)
    {
        e.CellElement.GradientStyle = GradientStyles.Solid;
        e.CellElement.BackColor = Color.White;
        e.CellElement.BorderColor = Color.FromArgb(209, 225, 245);
        e.CellElement.BorderWidth = 1;
        e.CellElement.BorderBottomColor = Color.FromArgb(209, 225, 245);
        e.CellElement.BorderBoxStyle = BorderBoxStyle.SingleBorder;
        e.CellElement.BorderGradientStyle = GradientStyles.Solid;
    }
    else
    {
        e.CellElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local);
        e.CellElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
        e.CellElement.ResetValue(LightVisualElement.BorderColorProperty, ValueResetFlags.Local);
        e.CellElement.ResetValue(LightVisualElement.BorderWidthProperty, ValueResetFlags.Local);
        e.CellElement.ResetValue(LightVisualElement.BorderBottomColorProperty, ValueResetFlags.Local);
        e.CellElement.ResetValue(LightVisualElement.BorderBoxStyleProperty, ValueResetFlags.Local);
        e.CellElement.ResetValue(LightVisualElement.BorderGradientStyleProperty, ValueResetFlags.Local);
    }
}
 
void EditorControl_RowFormatting(object sender, RowFormattingEventArgs e)
{
    if (e.RowElement.IsSelected || e.RowElement.IsCurrent)
    {
        e.RowElement.GradientStyle = GradientStyles.Solid;
        e.RowElement.BackColor = Color.White;
    }
    else
    {
        e.RowElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local);
        e.RowElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
    }
}

Off topic, please try to separate your questions regarding different subjects in different threads, so it will be easier for our community to find them if needed. See p.4 in this thread: http://www.telerik.com/community/forums/winforms/multicolumncombo/important-information-on-using-the-telerik-forums.aspx.

I hope this helps.
 
Kind regards,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
MultiColumn ComboBox
Asked by
Exclamation
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Exclamation
Top achievements
Rank 1
Share this question
or