problem with rule in a dropdowncolumn

4 posts, 1 answers
  1. danielnp20
    danielnp20 avatar
    22 posts
    Member since:
    Jun 2008

    Posted 19 Sep 2008 Link to this post

    Hi all,

    I have a RadGrid with diferent bound columns that represents one table of my DB and i use an user control to edit the registers and add new ones.

    The problem is that one of the columns in the table has a rule and only accepts the values 'L' or 'O' (Local or Other) and when i charge the info on the grid, in that column it shows the value 'L' or 'O' and i want it to show 'Local' or 'Other'. So i decided to create an XML file that contains all the rules with their respective text and values

    <?xml version="1.0" encoding="utf-8" ?> 
    <root> 
        <tipoComprobante_CHK> 
            <Item Text="Local" Value="L" /> 
            <Item Text="Casa Matriz" Value="M" /> 
            <Item Text="Ambos" Value="A" /> 
        </tipoComprobante_CHK> 
        <OtherRule_CHK> 
            <Item Text="Local" Value="L" /> 
            <Item Text="Other" Value="O" /> 
        </OtherRule_CHK> 
    </root> 
     


    According to this i supossed that i need to change a BoundColumn for a telerik:DropDownColumn, but i dont know how to put the info of one rule (XML) in the new column and how to declare the value that the column need to shows.

    <telerik:GridBoundColumn DataField="TipoComprobante" HeaderText="Tipo Comprobante" SortExpression="TipoComprobante" UniqueName="TipoComprobante" /> ...  works for the bound column               
     


    Also in the User Control when i want to edit a register and it has a FK to other table i declare a RadCombo and get the selected value really simple:

    <telerik:RadComboBox ID="rcbGrupo" runat="server" Height="190px" Width="420px"  
         MarkFirstMatch="true" DataSourceID="odsUsuarioGrupo" HighlightTemplatedItems="true"  
         DataTextField="Nombre" DataValueField="Id" NoWrap="True" Sort="Ascending"
         <HeaderTemplate> 
             <ul> 
                 <li class="rcbColumn">Id</li> 
                 <li class="rcbColumn">Nombre</li> 
             </ul> 
         </HeaderTemplate> 
         <ItemTemplate> 
             <ul> 
                 <li class="rcbColumn"><%# DataBinder.Eval(Container.DataItem, "Id") %></li
                 <li class="rcbColumn"><%# DataBinder.Eval(Container.DataItem, "Nombre") %></li
             </ul> 
         </ItemTemplate> 
         <CollapseAnimation Duration="100" Type="OutQuint" /> 
    </telerik:RadComboBox> 


    If is a new register the first item of the radComboBox is selected and for the edit mode the correct item is selected. But when a rule is in the column I'm creating a new DropDown and adding the items but i dont know how to get the correct value on edit mode, i dont have any 'databinder.eval.....' so always when the UC get oppened the first item get selected.

    Please it is realle important and i hope you can help me with this

    Regards,

    Daniel Peralta







  2. danielnp20
    danielnp20 avatar
    22 posts
    Member since:
    Jun 2008

    Posted 21 Sep 2008 Link to this post

    Hi again me ... please somebody help me with this .. where i can read about it ir see an example ... it is very important ...

    Thanks & regards,

    Daniel Peralta
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Kiara
    Kiara avatar
    309 posts
    Member since:
    Jul 2006

    Posted 23 Sep 2008 Link to this post

    Daniel, I read somewhere that the GridDropDownColumns are used when you have DataTable for source because thus the dropdown column Text/Value/DataMember fields can be set.
    For other scenarios with different types of source choose dropdown list in edit template of template column. I found this article on this subject.

    Kiara
  5. danielnp20
    danielnp20 avatar
    22 posts
    Member since:
    Jun 2008

    Posted 23 Sep 2008 Link to this post

    thx kiara .. that ws whth i need, the diference is hat i have to populate the combo with an XML but it is not problem.....
Back to Top