Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
281 views
I'm running into a number of issues trying to do validation of controls in a popup form template of a radGrid:

1) None of my client-side validation funtions are firing
2) I cannot get the NEW value of the radEditor in my server-side custom validation function
3) When the insert form is redisplayed with errors, the content of the radEditor displays the original value, not the new value (changes are lost)

I'm using IE 9.0, and radControls Q3 2012.

This is the code for two of my editor controls that are having an issue (and the update button):
<telerik:RadTextBox ID="rtbTItle" runat="server" Width="400" TextMode="SingleLine" Text='<%# DataBinder.Eval(Container, "DataItem.Title") %>' Skin="WebBlue">
</telerik:RadTextBox>
<asp:RequiredFieldValidator ID="rfvTitle" runat="server" ControlToValidate="rtbTitle"
    ErrorMessage="You must enter a Title" ValidationGroup="vgEditor" ForeColor="Red" Font-Bold="true">*</asp:RequiredFieldValidator>
<asp:CustomValidator ID="cvTitle" runat="server" ControlToValidate="rtbTitle"
    ClientValidationFunction="cvTitle_Validator" OnServerValidate="cvTitle_ServerValidate" EnableClientScript="true"
    ErrorMessage="Title cannot contain 'x'" ValidationGroup="vgEditor" ForeColor="Red" Font-Bold="true">x</asp:CustomValidator>
 
 
<telerik:RadEditor ID="reItemText" runat="server" BorderStyle="None"
    OnClientLoad="reItemText_OnClientLoad" OnClientModeChange="reItemText_OnClientModeChange"
    Width="800" Height="300" AutoResizeHeight="false" EnableResize="false" ToolsWidth="800"
    ContentAreaMode="Div" Skin="WebBlue" Content='<%# DataBinder.Eval(Container, "DataItem.ItemText") %>'>
</telerik:RadEditor>
<asp:CustomValidator ID="cvItemText" runat="server" ControlToValidate="reItemText"
    ClientValidationFunction="cvItemText_Validator" OnServerValidate="cvItemText_ServerValidate" EnableClientScript="true"
    ErrorMessage="Item Text is required" ValidateEmptyText="true" ValidationGroup="vgEditor" ForeColor="Red" Font-Bold="true">*</asp:CustomValidator>
 
 
<asp:Button ID="btnUpdate" runat="server" ValidationGroup="vgEditor" CausesValidation="true" Text='<%# IIf(TypeOf Container is GridEditFormInsertItem, "Insert", "Update") %>' CommandName='<%# IIf(TypeOf Container is GridEditFormInsertItem, "PerformInsert", "Update") %>' />

These are my client-side validation functions (neither of which gets fired):
function cvItemText_Validator( sender, args ) {
  console.log( "cvItemText_Validator" );
}
 
function cvTitle_ServerValidate( sender, args ) {
  console.log( "cvTitle_ServerValidate" );
}

And these are my server-side validation functions:
Protected Sub cvItemText_ServerValidate(source As Object, args As System.Web.UI.WebControls.ServerValidateEventArgs)
    System.Diagnostics.Debug.WriteLine("Admin_ManageNews:cvItemText_ServerValidate")
    System.Diagnostics.Debug.WriteLine(String.Format("  ItemText: {0}", args.Value))
    Dim oItem As GridEditableItem = DirectCast(DirectCast(source, CustomValidator).NamingContainer, GridEditableItem)
    Dim oEditor As RadEditor = DirectCast(oItem.FindControl("reItemText"), RadEditor)
    System.Diagnostics.Debug.WriteLine(String.Format("  ItemText: {0}", oEditor.Content))
 
End Sub
 
Protected Sub cvTitle_ServerValidate(source As Object, args As System.Web.UI.WebControls.ServerValidateEventArgs)
    System.Diagnostics.Debug.WriteLine("Admin_ManageNews:cvTitle_ServerValidate")
    System.Diagnostics.Debug.WriteLine(String.Format("  Title: {0}", args.Value))
    Dim oItem As GridEditableItem = DirectCast(DirectCast(source, CustomValidator).NamingContainer, GridEditableItem)
    Dim oRTB As RadTextBox = DirectCast(oItem.FindControl("rtbTitle"), RadTextBox)
    System.Diagnostics.Debug.WriteLine(String.Format("  Title: {0}", oRTB.Text))
End Sub

Both of the debug statements for the cvTitle validator display the correct value for the Title field, but neither debug statement for the cvItemText validator displays the new values, they display the old value.
Tsvetoslav
Telerik team
 answered on 26 Oct 2012
3 answers
193 views

hi, i have a grid with detailtable, loading in detailtablebind event, when i push a button i want loop all selected row in detail table also not expanded...
post some code...

<telerik:RadGrid runat="server" ID="rgrFatturazione" Skin="Vista"
                   AllowPaging="True" AllowSorting="True" GridLines="None" 
                   style="margin-top: 200px; margin-left:27px;"  Width="900px" 
                   ShowGroupPanel="True" oncolumncreated="rgrFatturazione_ColumnCreated" AllowMultiRowSelection="true"
                   ondetailtabledatabind="rgrFatturazione_DetailTableDataBind" 
               onitemcommand="rgrFatturazione_ItemCommand" 
               onitemdatabound="rgrFatturazione_ItemDataBound">
                   <GroupingSettings CaseSensitive="false" />
                   <PagerStyle Mode="NumericPages"/>
                   <ClientSettings>
                   <Selecting  AllowRowSelect="true"/>
                   </ClientSettings>
                   <MasterTableView ShowHeadersWhenNoRecords="true" >
                        <DetailTables>
                           <telerik:GridTableView Name="Commessa" Width="100%">
                               <Columns>
                                      <telerik:GridBoundColumn UniqueName="colCustomer" HeaderText="Cliente" Visible="false">
                                       </telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn UniqueName="colComm" HeaderText="Commessa" Visible="false">
                                       </telerik:GridBoundColumn>
                                       <telerik:GridClientSelectColumn UniqueName="checkCom"/>
                               </Columns>
                               <DetailTables>
                                   <telerik:GridTableView Name="Rapportini" Width="100%">
                                       <Columns>
                                                   <telerik:GridBoundColumn UniqueName="colCustomer" HeaderText="Cliente" Visible="false">
                                                   </telerik:GridBoundColumn>
                                                   <telerik:GridBoundColumn UniqueName="colComm" HeaderText="Commessa" Visible="false">
                                                   </telerik:GridBoundColumn>
                                                   <telerik:GridTemplateColumn UniqueName="colCheckRap" ItemStyle-HorizontalAlign="Center" AllowFiltering="false">
                                                       <ItemTemplate>
                                                           <asp:CheckBox runat="server" ID="checkRap" />
                                                       </ItemTemplate>
                                                   </telerik:GridTemplateColumn>                                                                                                     
                                                   <telerik:GridTemplateColumn UniqueName="colView" ItemStyle-HorizontalAlign="Center" AllowFiltering="false">
                                                       <ItemTemplate>
                                                           <asp:Image runat="server" ID="linkView" ImageUrl="~/images/Zoom.png">
                                                           </asp:Image>
                                                           <telerik:RadToolTip runat="server" Width="300" Height="300" RenderInPageRoot="true" ShowEvent="OnMouseOver"
                                                                   HideEvent="ManualClose" HideDelay="2" ID="Tooltip" Position="TopRight" Animation="Resize"
                                                                   RelativeTo="Element" >
                                                           </telerik:RadToolTip>
                                                       </ItemTemplate>
                                                   </telerik:GridTemplateColumn>
                                                   <telerik:GridTemplateColumn UniqueName="colView" ItemStyle-HorizontalAlign="Center" AllowFiltering="false">
                                                       <ItemTemplate>
                                                           <asp:LinkButton runat="server" ID="linkRappo" Text="Rapportino" CommandName="Rapportino">
                                                           </asp:LinkButton>
                                                       </ItemTemplate>
                                                   </telerik:GridTemplateColumn>
                                       </Columns>
                                   </telerik:GridTableView>
                               </DetailTables>
                           </telerik:GridTableView>
                   </DetailTables>                  
                   <Columns>
                           <telerik:GridBoundColumn UniqueName="colCustomer" HeaderText="Cliente" Visible="false">
                           </telerik:GridBoundColumn>
                           <telerik:GridBoundColumn UniqueName="colComm" HeaderText="Commessa" Visible="false">
                           </telerik:GridBoundColumn>
                   </Columns>
                   </MasterTableView>
           </telerik:RadGrid>
        
           <br />
           <asp:Button runat="server" ID="btnFattura" Text="Fattura" 
               onclick="btnFattura_Click"/>
protected void rgrFatturazione_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e)
       {
           GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
           if (e.DetailTableView.Name == "Commessa")
           {
               string Cliente2 = dataItem["Codice Cliente"].Text;
               e.DetailTableView.DataSource = this._LoadCommesse(int.Parse(Cliente2));
           }
           else
           {
               string Cliente3 = dataItem["Cliente Commessa"].Text;
               string Commessa = dataItem["Commessa"].Text;
               e.DetailTableView.DataSource = this._LoadRapportini(Commessa, int.Parse(Cliente3));
           }
       }
}
i try this but doesn't work..
protected void btnFattura_Click(object sender, EventArgs e)
        {
            foreach (GridDataItem clienti in rgrFatturazione.MasterTableView.Items)
            {
                foreach (GridDataItem commesse in clienti.ChildItem.NestedTableViews[0].Items)
                {
                    foreach (GridDataItem rapportini in commesse.ChildItem.NestedTableViews[0].Items)
                    {
                          
                    }
                }
            }
        }
thanks!!
Princy
Top achievements
Rank 2
 answered on 26 Oct 2012
3 answers
113 views
Hi.
How I can access columns in a radgrid by javascript?
I need to change their width upon him by this method.

This are the columns.
 <Columns>
                    <radG:GridBoundColumn SortExpression="region_id" HeaderText="Region" HeaderButtonType="TextButton"
                        DataField="region_id">
                    </radG:GridBoundColumn>
                    <radG:GridBoundColumn SortExpression="qty" HeaderText="Qty" HeaderButtonType="TextButton"
                        DataField="qty">
                    </radG:GridBoundColumn>
                    <radG:GridBoundColumn SortExpression="status" HeaderText="Status" HeaderButtonType="TextButton"
                        DataField="status">
                    </radG:GridBoundColumn>
                  
                </Columns>

Princy
Top achievements
Rank 2
 answered on 26 Oct 2012
1 answer
76 views
Hi
   I am usng 2012.2.724.35 telerik version. I am facing one issue on telerik grid where on selection of row ( every second row only) has problem in highlighting. so odd rows are doing good but not even . browser version is IE 8. please see the attached image


Best Regards
Rizwan Bashir
Princy
Top achievements
Rank 2
 answered on 26 Oct 2012
2 answers
368 views
Hi team,
how we can reset the grid setting to the default after loading the saved settings.
we want to have a "Reset" column which return the grid to the default settings.
Regards.
Mohammed
Mohammed
Top achievements
Rank 2
 answered on 26 Oct 2012
1 answer
96 views
How do I get an asp:label field that is contained within a GridTemplateColumn and bound to an underlying data field to appear as an editable field on an EditForm that is displayed by clicking Edit in a GridEditCommandColumn?
Shinu
Top achievements
Rank 2
 answered on 26 Oct 2012
3 answers
194 views
Heey guys a little question is it possible to set a title on a grid and how  ?


Thanks for answer ! 
Shinu
Top achievements
Rank 2
 answered on 26 Oct 2012
4 answers
63 views
I'm sure there is a discussion on this somewhere, but why is it after the Q3 2012 release the font sizing was changed to a size only my grandmother could love?  I mean since when is a 16 pt font considered the baseline normal? Now I find myself having to scale my browser to 75% just to get some semblence of usability when viewing the demo site.
Andrew
Top achievements
Rank 1
 answered on 26 Oct 2012
2 answers
124 views
As with many other people, I upgraded to your new release this weekend.  I have managed to get through most of the issues by reading the forums.  However, I have one issue that I haven't seen yet.

I created a new RAD c# website (.aspx) in VS2012.  When I have the display file open and try to drag and drop controls on to the page, any Microsoft control that I grab, drag, and drop on to the page work fine.  I tried many.  No problems.

When I grab any Telerik control (makes no difference which one or from which group), I drop the control on to the page and nothing happens.  No control is created.

If I manually create controls (such as copying ones from your demo site and pasting them into the page) the controls work just fine.  It's just that no Telerik controls from the Toolbox are created.

Any workarounds available?

Lynn
Lynn
Top achievements
Rank 2
 answered on 26 Oct 2012
3 answers
201 views
How can I disable the appointment textbox that pops up when I double click a cell in the scheduler?
Rajendra
Top achievements
Rank 1
 answered on 25 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?