Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
116 views
There is a RADDatePicker control inside the RADGRID and when they are editing the field, Invalid date error msg should be thrown and the Invalid date should persist with the error msg. With the help of hidden control, I got the Invalid date and displaying Invalid date error message but the wrong date wipes away. Is there a property to display the wrong date.
Eyup
Telerik team
 answered on 27 Feb 2013
1 answer
95 views
Hello Sir/Madam,

I m using rad grid with item command and selected index changed events now i want whenever i use item commad current row color should be changed as appear in selected index change event


                                                                                           or


or 2nd possibilty is also here that is i m using three rad grids in which 1st grid id is grd_optnandprcng so that whenever i fired item command of fthis grid then second grid data(id="Req_items") and Third grid data(id="opt_items") should not refresh or ajax refersh image should not appear with it but on selected index changed it should be refresh .

 <telerik:AjaxSetting AjaxControlID="grd_optnandprcng">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Req_items"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="opt_items"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>

so please tell me solution of both possibility.

Thanks
Eyup
Telerik team
 answered on 27 Feb 2013
1 answer
81 views

I need to create the following page layout with Splitters and Panes; the entire browser window should be occupied with the splitter and must grow and shrink with the browser. The page would have 3 main sections: top, middle, bottom. The top section will have a menu, the bottom section would have a table or a DocZone. The middle part is divided into two sections, left and right with a Splitbar to be able to move it to the right or left. Here is what’s really important:

  1. The 3 main sections must occupy the entire browser page
  2. When the page grows or shrinks, only the middle part would grow/shrink with it

 

Your help with this layout would be much appreciated,
-Sam

Dobromir
Telerik team
 answered on 27 Feb 2013
2 answers
184 views
I have 2 RadDateTime controls inside my <FormTemplate>

Editing works perfectly fine, but when I try and create a new item...it throws this...?

Any idea?...if I remove the SelectedDate property everything is fine again...

Exception Details: System.InvalidCastException: Specified cast is not valid.

Source Error:

Line 243:                                <div class="inputItem">
Line 244:                                    <label class="rcbLabel itemLabel">Opens:</label>
Line 245:                                    <telerik:RadDateTimePicker ID="fromDatePicker" runat="server" Width="245px" DateInput-DateFormat="dddd MMM dd, yyyy h:mmtt" Skin="Sitefinity" SelectedDate='<%# Eval("FromDate") %>'>
Line 246:                                        <DateInput runat="server" EnableSingleInputRendering="true" />
Line 247:                                    </telerik:RadDateTimePicker>

Source File: DesignBuilder\Default.aspx    Line: 245

Stack Trace:

[InvalidCastException: Specified cast is not valid.]
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 27 Feb 2013
1 answer
272 views
Hello,

I have a basic radSplitter setup, with a "navigation" pane on the left and a "content" pane on the right, divided by a split bar. We'll call this page "Main.aspx".

In the navigation pane, I have a radTreeView control which builds up nodes in groups based on database records. Clicking on a treeview node sets the content pane's ContentURL to a specific aspx page based on the node & parameters, etc. Within this content pane, I can step the user through a wizard-type interface.

If the user edits an item in the content pane or completes the wizard, I would like to be able to refresh the TreeView control via some sort of javascript, similar to what is found at http://www.telerik.com/support/kb/aspnet-ajax/splitter/referencing-content-page-in-a-splitter-pane-from-the-parent-page-and-vice-versa.aspx  without refreshing the entire page and losing the reference to the page in the content pane. This would update the treeview with the new or changed information.

Complex as it may be, the only real solution I can think of is to refresh the entire page while holding a value in Session. After the treeview builds, it can inspect the session value, highlight the node in question, and load the content pane base on the session value.

Do you have any better ideas?
Dobromir
Telerik team
 answered on 27 Feb 2013
2 answers
243 views
Hello!
I searched a while for this issue and can't seem to find. I have a multipage radtabstrip. When i click a radbutton in the first tab, i want the thrid one to open, load data, then trigger the insert command in the grid inside the 3rd tab.
Everything works from the moments i arrive in the load of my 3rd tab. My EventArguments still have what i sent from the first tab.

For the sake of showing my problem, here is how i do it from the javascript file:
//Client side function called by my button in the first tab:
triggerMyThridTab: function() {
    this._needToAdd = true;
    this._tabs.get_tabs().getTab(2).set_selected(true);
}
//.... calling the selected function
onTabSelected: function(sender, args){
    if(this._needToAdd){
      sender._userControl._needToAdd = true;
      sender._userControl._myThridTab.raise_load();
    }
}
//In my thirdTab usercontrol load function....
raise_load: function(){
    if(this._needToAdd){
      var myAction = "addNewEntry";
      eval("var exec = function() { $find(window.idAjaxManager).ajaxRequestWithTarget('" + this._triggerUniqueID + "', '\\{ \\'Action\\':\\'" + myAction + "\\'}' ); }");
      ExecRequeteAjax(this, exec, 5, null);//This calls the postback
    }
}

Then, i have this in my third tab load function :
'This is the userControl contained in the third tab
Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  If ValidateEventArguments() Then
    'I must open the grid in insert mode
    MyGrid.MasterTableView.IsItemInserted = True
    MyGrid.Rebind()
  End If
End Sub

In my Third tab, i have a grid with a custom userControl for the edit form:
<telerik:RadGrid ID="MyGrid" runat="server" >
   <EditFormSettings EditFormType="WebUserControl" UserControlName="~/UserControls/MyAddItemCustomUC.ascx" />
   <Columns>....</Columns>
</telerik:RadGrid>


My Problem is, i need to pass some viewstate properties to the userControl. Normally i do this in the grid itemCreated() function when the item is type of GridEditFormInsertItem.
Protected Sub MyGrid_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles MyGrid.ItemCreated
  If TypeOf e.item Is GridEditFormInsertItem Then
    Dim control As MyCustomEditUC = DirectCast(e.Item.FindControl(GridEditFormInsertItem.EditFormUserControlID), MyCustomEditUC)
    control.SomePropreties = PropretiesInViewState
  End If
End Sub

When i load the customUC, my properties is set, and i can use it. But, if i write IsItemInserted somewhere.... that variable is never set and my website crashes. I can't put the variable in the viewstate anywhere else, security issues, and thats how the website was made before i added this feature.

I hope my explanations were clear and someone might be able to answer me cause i really don't know what to do...

Sophie
Top achievements
Rank 2
 answered on 27 Feb 2013
5 answers
133 views
Hi
I have ComboBox with multicolumns which is embeded in RadGrid ->Columns ->GridTemplateColumn -> EditItemTemplate.
Orginally it had one checkbox column and 3 databound coulmns from SqlDataSource. I had to add new column and it had to be TextBox. After that when I click 'Save' while inserting new item I get error:

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500 


Here's my code:
<telerik:RadComboBox ID="RadComboBox1" runat="server" Height="200px" Width="300px"
                            DropDownWidth="520px" EmptyMessage="Select Item" HighlightTemplatedItems="true"
                            EnableLoadOnDemand="True" RadComboBoxImagePosition="Right" AllowCustomText="true"
                            DataTextField="hardware_no" DataValueField="id_comp"
                            SelectedValue='<%# Eval("id_comp") %>'  
                            Text='<%# Eval("hardware_no") %>'
                            AutoPostBack="False" 
                            DataSourceID="SqlDataSource1" 
                            >
                            <HeaderTemplate>
                                <table style="width: 480px" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td style="width: 20px;">
                                            </td>
                                        <td style="width: 35px;">
                                            Amount</td>
                                        <td style="width: 100px;">
                                            Hardware Nr</td>
                                        <td style="width: 160px;">
                                            Department</td>
                                        <td style="width: 140px;">
                                            Person</td>
                                              
                                    </tr>
                                </table>
                            </HeaderTemplate>
                            <ItemTemplate>
                                  
                                <table style="width: 480px" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td style="width: 20px;">
                                            <asp:CheckBox runat="server" ID="chk1" Checked="false" />
                                        </td>
                                        <td style="width: 35px;">
                                            <asp:TextBox ID="TextBoxAmount" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "amount") %>' Width="25" ></asp:TextBox>  
                                              
                                        </td>
                                        <td style="width: 100px;">
                                            <%# DataBinder.Eval(Container.DataItem, "no_h")%>
                                        </td>
                                        <td style="width: 160px;">
                                            <%# DataBinder.Eval(Container.DataItem, "dept")%>
                                        </td>
                                        <td style="width: 140px;">
                                            <%# DataBinder.Eval(Container.DataItem, "person")%>
                                        </td>
                                          
                                    </tr>
                                </table>
                                 
                            </ItemTemplate>
                        </telerik:RadComboBox>

All data fields from SqlDataSource are provided from strored procedure, including the TextBox one - 'amount'

Please help
Thx
Konrad
Nencho
Telerik team
 answered on 27 Feb 2013
8 answers
296 views
I have a telerik:RadGrid with inline editing using a user control.  The problem is that the user control when examined from inside the OnEditCommand event is always null; although a trace of the asp.net page shows that the controls are rendered.

My Radgrid definition:
<telerik:RadGrid runat="server" AllowPaging="True" ID="grdSPFilters" OnNeedDataSource="grdSPFilters_NeedDataSource"
                        Width="350px" OnRowDrop="grdSPFilters_RowDrop" AllowMultiRowSelection="false"
                        OnEditCommand="grdSPFilters_EditCommand" AutoGenerateColumns="false">

My Radgrid edit area definition:
<EditFormSettings UserControlName="FilterMatchRuleBuilder.ascx" EditFormType="WebUserControl">
                                <EditColumn UniqueName="FilterMatchRuleBuilder01">
                                </EditColumn>
 </EditFormSettings>

My event:
public void grdSPFilters_EditCommand(object sender, GridCommandEventArgs e)
 {
    // snip...
    GridDataItem item = (GridDataItem)e.Item;
   FilterMatchRuleBuilder frb = item.FindControl("FilterMatchRuleBuilder01") as FilterMatchRuleBuilder;

the problem is here - the item.Findcontrol never finds my user control.  I've tried enumerating through the entire item.Controls collection and no user controls exist.  Although a trace of the asp.NET page shows the user control has been rendered.  What is happening here?  All the Telerik articles I've seen demonstrate that you simply use an item.Findcontrol; however that simply does not work.

Another thing that doesn't make sense.  Inside my grdSPFilters_EditCommand method e.Item.IsInEditMode is always equal to false.
Geoff Ballard
Top achievements
Rank 1
 answered on 27 Feb 2013
1 answer
114 views
hi .i use RadSplitter in my masterpage and create mywebform by master page
but i have a problem with this commponent
i can use this but in run time i have problem and the problem is contentplaceholder in mywebform has merged by the footer of page and i cant use it in seperated window.
I've attached a picture to better understand the problem.
Please help.
MasterPge:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Main.master.cs" Inherits="Automation.Main" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
    <link href="Styles/CssReset.css" rel="stylesheet" />
</head>
<body >
    <form ids="form1" runat="server">
       <telerik:RadScriptManager runat="server" ID="RadScriptManager1"></telerik:RadScriptManager>
        <div class="header">
            <h1>Your Name Here</h1>
            <h2>My Personal Site</h2>
         
            <div class="menua">
            </div>
        </div>
        <div class="context" >
         
            <telerik:RadSplitter ID="RadSplitter1" runat="server" Width="100%" Height="100%">
            <telerik:RadPane runat="server" ID="RadPane1" Width="70%">
                <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
                      </asp:ContentPlaceHolder>
            </telerik:RadPane>
            <telerik:RadSplitBar runat="server" ID="RadSplitbar1" CollapseMode="Backward" />
            <telerik:RadPane runat="server" ID="Radpane2" Width="330px">
            </telerik:RadPane>
        </telerik:RadSplitter>
           
        </div>
        <div class="footerbg">
            <div class="footer">
            </div>
        </div>
 
    </form>
</body>
</html>

Webform:
<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="Automation.WebForm2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="content">
            <h3>Request an Account</h3>
            <p>Accounts will be activated pending the approval of the Administrator.</p>
            
        </div>
</asp:Content>

Dobromir
Telerik team
 answered on 27 Feb 2013
1 answer
88 views

I'm using a RadHtmlChart based on HTML5 from telerik. I'm using a Pie Chart, and I want to display the method's values. How should I save the values -- maybe as a list? It shouldn't have a big impact on the method itself, because I need this method for some report stuff.

public double GetBookedVacation(int year)
{
    int counter = 0;
    if (this.AnnualVacations.Any())
    {
        foreach (HtVacationDay vacationDay in HtVacationDays)
        {
            foreach (DateTime vacationDayDate in vacationDay.GetDates())
            {
                if (vacationDayDate.Year == year)
                {
                    counter++;
                }
            }
        }
    }
    return counter;
}

Thanks for help and fast answer.

Danail Vasilev
Telerik team
 answered on 27 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?