set and get value combobox multicolumn

6 posts, 1 answers
  1. hesam
    hesam avatar
    26 posts
    Member since:
    May 2008

    Posted 18 Oct 2008 Link to this post

    hi 
    how i can set datavaluemember and get that value in select index change in combobox multicolumn
    thank a lot
  2. Answer
    John
    John avatar
    30 posts
    Member since:
    Aug 2008

    Posted 20 Oct 2008 Link to this post

    The code below shows a LinqToSql table being bound to the control and then accessing the value from the control in the SelectedIndexChanged event.  Hope this helps.

            private void Form1_Load(object sender, EventArgs e)  
            {  
                NorthwindDataContext db = new NorthwindDataContext();  
                this.radMultiColumnComboBox1.DataSource = db.Orders;  
                this.radMultiColumnComboBox1.ValueMember = "CustomerID";  
            }  
     
            private void radMultiColumnComboBox1_SelectedIndexChanged(object sender, EventArgs e)  
            {  
                this.Text = radMultiColumnComboBox1.SelectedValue.ToString();  
            } 
  3. UI for WinForms is Visual Studio 2017 Ready
  4. parag patel
    parag patel avatar
    12 posts
    Member since:
    Oct 2009

    Posted 20 Jan 2010 Link to this post

    hi I am assigning value member of that combobox.

    And also attaching data binding with selected value but I am not getting desired value  selected value

    can you help me in this?

     I am putting my code here:


     CmbTry.DisplayMember = "RaceType"
     CmbTry.ValueMember = "RaceType"

    Dim objPatient As PatientMaster
            objPatient = PatientMaster.Fetchpatient(3220)
            objPatient.Race = "Apache"


            CmbTry.DataSource = objDt
            CmbTry.DataBindings.Add("SelectedValue", objPatient, "Race")
            'CmbTry.DataBindings.Add("SelectedValue", objPatient, "Race", False, DataSourceUpdateMode.OnPropertyChanged)

            CmbTry.AutoFilter = True
            Dim filter As New FilterExpression(CmbTry.DisplayMember, FilterExpression.BinaryOperation.AND, GridKnownFunction.StartsWith, GridFilterCellElement.ParameterName)
            filter.Parameters.Add(GridFilterCellElement.ParameterName, String.Empty)
            Me.CmbTry.EditorControl.MasterGridViewTemplate.FilterExpressions.Add(filter)
            Me.CmbTry.MultiColumnComboBoxElement.AutoCompleteMode = AutoCompleteMode.None
            Me.CmbTry.DropDownStyle = RadDropDownStyle.DropDown
  5. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 25 Jan 2010 Link to this post

    Hello Parag,

    Thank you for contacting us.

    I reviewed your code, but I am not quite sure that I correctly understand the scenario you are trying to implement. Therefore, I would like to ask you to prepare a sample Windows Forms application that demonstrates what you are trying to achieve. This will allow me to provide you with further help.

    Please note you have to open a new support ticket in order to attach a sample project.

    Thank you for your time.

    Best wishes,
    Deyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Ahmed
    Ahmed avatar
    8 posts
    Member since:
    Sep 2012

    Posted 14 Jul 2014 in reply to John Link to this post

    hi i have Multi-column Combo box
     <telerik:RadComboBox ID="RadComboIteamCode" runat="server" Width="350px"
         EmptyMessage="Choose a Product" HighlightTemplatedItems="true" EnableLoadOnDemand="true"
         Filter="StartsWith" onitemsrequested="RadComboIteamCode_ItemsRequested"
            OnClientDropDownClosed="OnClientDropDownClosed">
            <HeaderTemplate>
                <table style="width: 275px" cellspacing="0" cellpadding="0">
                    <tr>
                        <td style="width: 100px;">
                            Product Code
                        </td>
                        <td style="width: 200px;">
                            Product Name
                        </td>
                        <td style="width: 60px;">
                            Product Price
                        </td>
                    </tr>
                </table>
            </HeaderTemplate>
            <ItemTemplate>
                <table style="width: 275px" cellspacing="0" cellpadding="0">
                    <tr>
                        <td style="width: 100px;">
                            <%# DataBinder.Eval(Container, "Text")%>
                        </td>
                        <td style="width: 200px;">
                            <%# DataBinder.Eval(Container, "Attributes['ProductName']")%>
                        </td>
                        <td style="width: 60px;">
                            <%# DataBinder.Eval(Container, "Attributes['ProductPrice']")%>
                        </td>
                    </tr>
                </table>
            </ItemTemplate>
        </telerik:RadComboBox>
    and in client side i wanna select the value and text of this combobox
    i try all functions i find (get_text ,get_value .....)and in the end get Null or the Empty Message or nothing
    i wish if you can help me in that
  7. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 15 Jul 2014 Link to this post

    Hello Ahmed,

    Your code seems to concern a ASP.NET AJAX control, while this forums is for Telerik UI for WinForms. Please address your question in the appropriate forums (http://www.telerik.com/forums/aspnet-ajax) in order to get adequate support.

    I hope this helps.

    Regards,
    Stefan
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top
UI for WinForms is Visual Studio 2017 Ready