Site Search:
Sign in | Join | Help
4Penny.net

ComponentArt

December 2007 - Posts

  • Accessing the other columns in a multi column ComponentArt combobox

    From a recent support request:

    I have a multi column combo, build like so:

                         <ClientTemplates>  
                            <ComponentArt:ClientTemplate ID="itemTemplate">
                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                    <tr class="dataRow">
                                        <td class="dataCell" style="width: 100px;">## DataItem.getProperty('itemnmbr') ##</td>
                                        <td class="dataCell" style="width: 50px;"> ## DataItem.getProperty('uofm') ## </td>
                                        <td class="dataCell" style="width: 50px;"> ## DataItem.getProperty('tracked') ## </td>
                                        <td class="dataCell" style="width: 100px;" visible="false"> ## DataItem.getProperty('VNDITNUM') ## </td>
                                    </tr>
                                </table>
                            </ComponentArt:ClientTemplate>
                        </ClientTemplates> 
                        <dropdownheader>
                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tr class="headingRow">
                                    <td class="headingCell" style="width:100px;">Item</td>
                                    <td class="headingCell" style="width:50px;">UofM</td>
                                    <td class="headingCell" style="width:50px;">Lot Item</td>
                                    <td class="headingCell" style="width: 100px;" visible="false">Vend Item</td>
                                </tr>
                            </table>
                        </dropdownheader>

    I have having two issues with this:
    1) On postback, how can I access the other columns in the selected item? In the example above, 'itemnmbr' is the 'datatextfield' and I can get access to that, but can I get the 'uofm' or the 'vnditnum' field?

    2)If the above is possible, can I hide items in the multicolumn combo? Currently, I can set their visibility to false, but they still take up space.

    Answer:

    Hello, You access them the same way you had set them in your code (assuming you're basing this off of one of our demos)- the code to create the item would be like:  item["myproperty"] = "value"; To access it, you would do: item["myproperty"[.ToString().  And as far as hiding goes, the template is still in the colleciton, so you should actually remove the item entirely instead.  Stephen HatcherDeveloper Support ManagerComponentArt Inc.