Combo Custom Attribute

4 posts, 0 answers
  1. Cush
    Cush avatar
    88 posts
    Member since:
    Apr 2010

    Posted 22 Mar 2011 Link to this post

    Hi All

    I am currently using the method below to poulate a combobox on the page load event:

    Dim dataAdapter as new SetTableAdapter.someidentityTableAdapter
    Dim adapterTable as DataTable
      
    adapterTable = dataAdapter.getData()
      
    Radcombo1.DataValueField = "Value1"
    Radcombo1.DataTextField = "Value2"
    Radcombo1.DataSource = adapterTable
    Radcombo1.DataBind()

    I would like to add a custom attribute to this combo box,
    I am able to achive this in a load on demand senario but not the senario above!
    Would someone be kind enough to point me in the right direction on how to achive this please?

    Also when using custom attributes in this way is it still only possible to get the attributes value client side?

    Many Thanks

    Regards

    Darren
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 23 Mar 2011 Link to this post

    Hello,


    You could add the "Custom Attribute" in ItemDataBound event of RadComboBox. In the ItemDataBound event get the field value and set the custom attribute as shown in the follwoing documentation.
    ItemDataBound



    Thanks,
    Princy.
  3. Cush
    Cush avatar
    88 posts
    Member since:
    Apr 2010

    Posted 23 Mar 2011 Link to this post

    Hi Princy

    Thanks for that,
    I did see that before but didt try it as it looked too easy !!!!!!

    Anyway that worked a treat thank you,

    All i have got to do now is get the selected item Custom Attribute value on page load.

    Many Thanks

    Regards

    Darren
  4. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 25 Mar 2011 Link to this post

    Hello Cush,

    I would suggest that you take a look at the following help article:Custom Attributes. I believe it describes the diffrent scanarios that may be very helpful to you.

    Best wishes,
    Kate
    the Telerik team
Back to Top