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
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.
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:
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
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