Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > ComboBox and ListBox (obsolete as of Q2 2010) > RadListBox doesn't highlight the selected line

Not answered RadListBox doesn't highlight the selected line

Feed from this thread
  • Posted on May 10, 2011 (permalink)

    as:
    {
       listBox.DataSource = m_dtRequisition;
       listBox.DisplayMember = "FileName";
       listBox.ValueMember = "RequisitionGuid";
    }




    when i should select the last index for radlistbox,  but why the listbox doesn't highlight the selected line? 
    {
       DataTable dt = listBox.DataSource as DataTable;
       listBox.selectedindex = dt.Rows.Count;
    }

    Reply

  • Posted on May 10, 2011 (permalink)

    It is ok as

     DataTable dt = listBox.DataSource as DataTable;
                    if (dt.Rows.Count > 0)
                    {
                        listBox.SelectedIndex = dt.Rows.Count - 1;
                    }

    Reply

  • Peter Peter admin's avatar

    Posted on May 12, 2011 (permalink)

    Hello deng,

    Thank you for the writing.

    Indeed, in order to select the last item, you should set the SelectedIndex to the Count minus one. I am glad that you have found the answer to the question.

    I would like to let you know that RadListBox control is obsolete since Q2 2010. Once we release Q2 2011, this control will no longer be supported. This is why, it is highly recommendable to upgrade to its ancestor - RadListControl.

    Best wishes,
    Peter
    the Telerik team
    Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > ComboBox and ListBox (obsolete as of Q2 2010) > RadListBox doesn't highlight the selected line
Related resources for "RadListBox doesn't highlight the selected line"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]