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

Radgrid and RadNumericTextBox

1 Answer 186 Views
Grid
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
George asked on 25 May 2012, 10:28 AM
Hello 
i have  a problem with Radgrid and RadNumericTextBox
i am using a EditFormType Template that user updates only 2 values
 from the selected row of gridview.

inside that template i am using a RadNumericTextBox to let user insert a 
desired numeric value...
the problem is that when i hit the Update button , NULL value is stored in
database....If i use a standart
asp textbox the value is stored fine.
Could somebody help?






<
telerik:RadGrid ID="RadGrid1" runat="server"  AllowAutomaticUpdates="True"
                                AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True"
                                AutoGenerateEditColumn="True"
            DataSourceID="SqlDataSource1" GridLines="None"
  
                                PageSize="100" ShowGroupPanel="True" Skin="Default">
                                <ClientSettings AllowDragToGroup="True">
                                    <Selecting AllowRowSelect="True" />
                                    <ClientEvents OnRowDblClick="RowDblClick" />
                                </ClientSettings>
                                <MasterTableView  autogeneratecolumns="False" datakeynames="ic"
                                    datasourceid="SqlDataSource1" EditMode="PopUp" GroupLoadMode="Client">
                                    <GroupByExpressions>
                                        <telerik:GridGroupByExpression>
                                            <SelectFields>
                                                <telerik:GridGroupByField FieldAlias="symbasi" FieldName="symbasi" />
                                            </SelectFields>
                                            <GroupByFields>
                                                <telerik:GridGroupByField FieldName="symbasi" />
                                            </GroupByFields>
                                        </telerik:GridGroupByExpression>
                                    </GroupByExpressions>
                                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                        <HeaderStyle Width="20px" />
                                    </RowIndicatorColumn>
                                    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                        <HeaderStyle Width="20px" />
                                    </ExpandCollapseColumn>
                                    <Columns>
                                        <telerik:GridBoundColumn AllowFiltering="false" Visible="false" UniqueName="ic" HeaderText="ic" DataField="ic">
                                        <HeaderStyle Width="60px"></HeaderStyle>
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn  UniqueName="Symbasi" HeaderText="Σύμβαση" DataField="Symbasi">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="Logar" HeaderText="Λογαριασμός" DataField="Logar">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="asset_class" HeaderText="Asset Class" DataField="asset_class">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="poso" HeaderText="Ποσό" DataField ="poso"  dataFormatString="{0:###,##0.00}" >
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="pososto" HeaderText="Ποσοστό" DataField="pososto" dataFormatString="{0:###,##0.00}"  >
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="Ekptosi" HeaderText="Εκπτωση" DataField="Ekptosi" dataFormatString="{0:###,##0.00}">
                                        </telerik:GridBoundColumn>     
                                        <telerik:GridBoundColumn UniqueName="Total" HeaderText="Total" DataField="Total" dataFormatString="{0:###,##0.00}">
                                        </telerik:GridBoundColumn>
                                    </Columns>
                                     
                                    <EditFormSettings   InsertCaption="Add new item" CaptionFormatString="ic: {0}"
                CaptionDataField="ic" EditFormType="Template" PopUpSettings-Modal="true">
                                        <EditColumn    FilterControlAltText="Filter EditCommandColumn column">
                                        </EditColumn>
                                        <FormTemplate>
                                            
                                            <table ID="Table1" border="0" cellpadding="1" cellspacing="1" width="250">
  
                                                <tr>
                                                    <td>
                                                        Ποσό: </td><td>
                                                        <asp:TextBox ID="TextBox1" Enabled="false" runat="server" Text='<%# Bind("poso","{0:0.00}") %>' > </asp:TextBox></td></tr><tr>
                                                    <td>
                                                        ΕΚΠΤΩΣΗ: </td><td>
                                                       <telerik:RadNumericTextBox
                                                         ID="TextBox10"  
                                                         DbValue='<%#  Convert.ToDouble(Eval("Ekptosi"))   %>'
                                                         runat="server"
                                                         ShowSpinButtons="true" 
                                                         MinValue="0"
                                                         MaxValue='<%# Convert.ToDouble(Eval("poso")) %>'>
                                                         <ClientEvents OnKeyPress="NumericTextBoxOnLoad" />
                                                       </telerik:RadNumericTextBox>
  
                                                    </td></tr><tr>
                                            </tr><tr>
                               
                                 </tr></table><table style="width: 100%">
                                                <tr>
                                                    <td align="right" colspan="2">
                                                        
                                                        <asp:Button ID="Button1" runat="server" CommandName="Update" Text="Update"   />
                                                          <asp:Button ID="Button2" runat="server" CausesValidation="False"
                                                            CommandName="Cancel" Text="Cancel" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </FormTemplate>
  
                                    </EditFormSettings>
                                </MasterTableView>
                               
                            </telerik:RadGrid>

1 Answer, 1 is accepted

Sort by
0
George
Top achievements
Rank 1
answered on 25 May 2012, 10:40 AM
ok i found the solution
the dbvalue of textbox have to be with Bind 

      DbValue='<%#  bind("Ekptosi") 
Tags
Grid
Asked by
George
Top achievements
Rank 1
Answers by
George
Top achievements
Rank 1
Share this question
or