This is a migrated thread and some comments may be shown as answers.

FormTemplate - Manually parse data on item update/insert

2 Answers 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mSchmidt
Top achievements
Rank 1
mSchmidt asked on 06 Oct 2008, 01:09 PM
Hi

Iam creating a FormTemplate. And i have alot of textfields and number fields which are easily bound using the Bind("") method.


However i have some fields that are not databound and i have a color picker which cant seem to be databound (my color value may be null)
I also have a ComboBox where the selected value may no longer exist.

I think i need to manually insert the values when an Edit is started and ended. However how should i do this ?

Currently i use 

e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);

Which works very well however i cant access none databound items using this, can i ?

I have added an example of a Bound RadTextBox and an unbound colorpicker.

<tr> 
                <td> 
                    Kommentar</td> 
                <td> 
                    <telerik:RadTextBox ID="RadTextBox6" Runat="server"   
                        Width="125px" Text='<%#Bind("ingredient_comment") %>'>  
                    </telerik:RadTextBox> 
                </td> 
            </tr> 
            <tr> 
                <td> 
                    Farve</td> 
                <td> 
                    <telerik:RadColorPicker ID="RadColorPicker1" Runat="server"   
                        CurrentColorText="(Nuværende farve er {0})" NoColorText="Ingen farve"   
                        PickColorText="Vælg farve" Preset="Standard" ShowIcon="True" SelectedColor='<%#Bind("ingredient_color") %>'>  
                    </telerik:RadColorPicker> 
                </td> 
            </tr> 

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 06 Oct 2008, 01:22 PM
Hi,

Check out the code library link below that discusses on how to perform manual insert /update/delete in Form Template

Manual Insert/Update/Delete using FormTemplate and Sql backend

Thanks,
Princy
0
mSchmidt
Top achievements
Rank 1
answered on 06 Oct 2008, 02:45 PM
Okay, ya that example works great when storing the data back to the sql.

However what do i do to load the data to the Form when an edit form is activated.

Additionally i would like to have default value when an insert form is started, for example here i bind to a column but if it is null i would like it to state a 1.
<telerik:RadNumericTextBox ID="IngrDec4" Runat="server"   
                       NumberFormat-DecimalDigits="3"  Culture="Danish (Denmark)"   
                       DbValue='<%# Bind("ingredient_parcelquantity") %>' 
                         Type="Number" Width="45px" Value="1" > 
                    </telerik:RadNumericTextBox> 
Tags
Grid
Asked by
mSchmidt
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
mSchmidt
Top achievements
Rank 1
Share this question
or