Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
262 views
Guys I have a field called emp_DOB

I want to add a template field and show the age, how can I do this? I am using the Rad grid

Matt
Jayesh Goyani
Top achievements
Rank 2
 answered on 09 Jul 2012
1 answer
88 views
Hi,

I am trying to validate the columns in an inserted row client side and can't figure out how to get a reference to the individual columns in the inserted row.

I have tried the function listed below but it returns 'undefined'

   function SaveNew(sender, eventArgs) {
        var masterTable = $find("<%= rgvMainGrid.ClientID %>").get_masterTableView();
        //gets the HTML object of the insert item opened in the current GridTableView
        var insertedItem = masterTable.get_insertItem();
        alert(insertedItem[1]);

    }


I have seen an example where the javascript is added in the code behind and the column values are sent to the client but there are about 20 columns I want to validate and just want to be able to create the script on the page.

Any assistance would be appreciated.
Thank You
Shinu
Top achievements
Rank 2
 answered on 09 Jul 2012
10 answers
242 views
Hi,

Just tried to put a simple RadScheduler with webservice binding in an usercontrol, but get a javascript error when loading the page. the error says "The server method 'GetAppointments' failed." the "OnClientRequestFailed" is fired as well. If I put the same radscheduler control directly in a aspx page, it works fine. Is there any specific settings for such scenario?  Thanks in advance.

ascx code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Scheduler.ascx.cs" Inherits="Usercontrols_Scheduler" %>
 
<telerik:RadScheduler ID="RadScheduler1" runat="server"AppointmentStyleMode="Default"
    SelectedView="WeekView" Width="100%" Height="100%" Culture="en-AU" WeekView-HeaderDateFormat="d/MM/yyyy"
    TimelineView-HeaderDateFormat="d/MM/yyyy" TimelineView-ColumnHeaderDateFormat="ddd d/MM"
    AdvancedForm-ZIndex="7002">
    <AdvancedForm Modal="true" />
    <TimelineView NumberOfSlots="7" />
    <WebServiceSettings Path="../SchedulerWebService.asmx" ResourcePopulationMode="ServerSide" />
</telerik:RadScheduler>

aspx page (parent page):
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="Forms_MasterData_test" %>
 
<%@ Register Src="../../Usercontrols/Scheduler.ascx" TagName="Scheduler" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1">
    </telerik:RadScriptManager>
    <div>
        <uc1:Scheduler ID="Scheduler1" runat="server" />
    </div>
    </form>
</body>
</html>


Jason Li
Top achievements
Rank 1
 answered on 09 Jul 2012
2 answers
228 views
Hi,

I have this code:
 

<telerik:RadComboBox ID="rcbPageSize"

runat="Server"

skin="Gray"

AllowCustomText="true"

Style="float:right; margin-left: 5px;"

Width="60px"

OnClientTextChange = "PageSizeChanged"
OnClientSelectedIndexChange =  "PageSizeChanged">

<Items>

    <telerik:RadComboBoxItem runat="Server" Text="10" Value="10" />

    <telerik:RadComboBoxItem runat="Server" Text="20" Value="20" Selected="true" />

    <telerik:RadComboBoxItem runat="Server" Text="50" Value="50" />

    <telerik:RadComboBoxItem runat="Server" Text="150" Value="150" />

    <telerik:RadComboBoxItem runat="Server" Text="250" Value="250" />

</Items>

</telerik:RadComboBox>

 

<telerik:RadCodeBlock ID="rcb" runat="server">

 <script type="text/javascript">

 

 

function PageSizeChanged(sender, eventArgs) {

alert("You typed " + sender.get_text());

}

 

 

 

</script>

</telerik:RadCodeBlock>

 

 

 

 

When I change the selection, the function "PageSizeChanged" is called, but when I change the text by typing inside the combobox, the function is never called.

Do you have any idea why?

Thanks for the help.

 

 

 

 

Covertix
Top achievements
Rank 1
 answered on 08 Jul 2012
1 answer
99 views
Has anybody decided to create a UI sample for a forum control?  Maybe a silly question but I know you have a pretty complex dashboard demo, just wondering if you had a forum demo.
Jayesh Goyani
Top achievements
Rank 2
 answered on 08 Jul 2012
0 answers
119 views
Hi
I'M Use RadComboBox in radTreeList In Bellow Code

<telerik:TreeListTemplateColumn DataField="User_ID" UniqueName="User_ID"
                    HeaderText="شناسه کاربر" DataType=System.Int32 HeaderStyle-CssClass="RadGrid" 
                    HeaderStyle-HorizontalAlign=Right ItemStyle-HorizontalAlign=Right>
                      <ItemStyle HorizontalAlign="Right" Width="110px" CssClass=RadGrid />
                      <HeaderStyle HorizontalAlign="Right" Width="110px" CssClass=RadGrid />
                    <ItemTemplate>
                      <asp:Label ID="Label3" runat="server" Text='<%# Eval("User")%>' CssClass=RadGrid Width="100%" />
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadComboBox ID="E_cmbUser_ID" runat="server" DataSourceID="SQLDSUser_ID" Width="100px"
                            DataTextField="Name" DataValueField="ID" CssClass=RadGrid />
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <telerik:RadComboBox ID="I_cmbUser_ID" runat="server" DataSourceID="SQLDSUser_ID" Width="100px"
                            DataTextField="Name" DataValueField="ID" CssClass=RadGrid />
                    </InsertItemTemplate>
                </telerik:TreeListTemplateColumn>


Problem When Insert Or Edit Aoutomatic Insert Button In RadTreeList .
Return Null Value From Sql In RadComboBox

and Not Access To RadComboBox 

Tanx

mehdi
Top achievements
Rank 1
 asked on 08 Jul 2012
1 answer
88 views
I have the grid like this:
    <telerik:RadGrid ID="ReportsListGrid" ShowStatusBar="true" runat="server" AllowPaging="True"
        AllowSorting="true" AllowMultiRowSelection="True" PageSize="20" OnNeedDataSource="ReportsListGrid_NeedDataSource">
        <MasterTableView TableLayout="Fixed" DataKeyNames="ReportId" AutoGenerateColumns="True">
            <Columns>
                <telerik:GridBoundColumn DataField="ReportId" HeaderText="ReportId" AllowFiltering="false"
                    SortExpression="ReportId" />
                <telerik:GridBoundColumn DataField="Name" HeaderText="Name" SortExpression="Name" />
                <telerik:GridBoundColumn DataField="Description" HeaderText="Description" SortExpression="Description" />
                <telerik:GridBoundColumn DataField="ReportLocation" HeaderText="ReportLocation" SortExpression="ReportLocation" />
                <telerik:GridBoundColumn DataField="Active" HeaderText="Active" SortExpression="Active" />
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>

And Following is how i am binding it:

        Dim reports = ReportFactory.CreateReportController().GetReports()
'reports is IList  collection
        ReportsListGrid.DataSource = reports
        ReportsListGrid.DataBind()

On the pageload grid loads correctly, but when i click on any column header for sorting it says: 

"System.IndexOutOfRangeException: Cannot find column ReportLocation."

Please help!!!!!!!!!!!

Thanks J
Jayesh Goyani
Top achievements
Rank 2
 answered on 07 Jul 2012
1 answer
83 views
I am having Copy icon and edit icon in a row, when I click on copy I would like to do the same behavior for edit click, means I would like to open the edit template is it possible to do.
Jayesh Goyani
Top achievements
Rank 2
 answered on 07 Jul 2012
9 answers
327 views
Hi all,

I have a tree list and 2 radio button under this tree list... when i try to find the radio button on my tree list its state has been always checked false.. i have assigned the auto postback .. but its not working it seems..

Source is 
<td>
  <asp:RadioButton ID="rbDepPer" runat="server" GroupName="dep" />
  <telerik:RadNumericTextBox ID="txtBoxDepPer" Text='<%# Bind("DepPer") %>' runat="server">
  </telerik:RadNumericTextBox>
 </td>
  <td>
  Depreciation Year:
 </td>
 <td>
<asp:RadioButton ID="rbDepYear" runat="server" GroupName="dep" />
 <telerik:RadNumericTextBox ID="txtBoxDepYear" Text='<%# Bind("DepYear") %>' runat="server"
 Width="300px" >
 </telerik:RadNumericTextBox>
   </td>
Code Behind
Protected Sub RadTreeList1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.TreeListItemCreatedEventArgs) Handles RadTreeList1.ItemCreated
       If TypeOf e.Item Is TreeListEditFormItem AndAlso DirectCast(e.Item, TreeListEditFormItem).IsInEditMode Then
           Dim item As TreeListEditableItem = TryCast(e.Item, TreeListEditableItem)
           Dim rad1 As RadioButton = DirectCast(item.FindControl("rbDepPer"), RadioButton)
           Dim rad2 As RadioButton = DirectCast(item.FindControl("rbDepYear"), RadioButton)
           Dim textBox = TryCast(item.FindControl("txtBoxDepPer"), RadNumericTextBox)
           Dim textBox2 = TryCast(item.FindControl("txtBoxDepYear"), RadNumericTextBox)
           rad1.AutoPostBack = True
           rad2.AutoPostBack = True
           If rad1.Checked = True Then
               textBox.Enabled = True
               textBox2.Enabled = False
           ElseIf rad2.Checked = True Then
               textBox2.Enabled = True
               textBox.Enabled = False
           End If
       End If
   End Sub


I need to set visibility of that text box control while clicking the radio button..
Please help..


Regards,

Prassin
Prassin
Top achievements
Rank 1
 answered on 07 Jul 2012
1 answer
54 views
I am trying to create a very very basic form template, that looks like below

Employee Details

Officer Information                      Department Information                  Status
Label   Txt Box                            Label   Txt Box                                Label     Chx Box
Label   Txt Box                            Label   Txt Box                                Label     Text Box
Label   Txt Box                            Label   Txt Box 
Label   Txt Box                            Label   Txt Box 
Label   Txt Box                            Label   Txt Box 
Label   Txt Box                            Label   Txt Box 


Update    Cancel

below is the code I got and it is all screwed up, I tried to use the edit template designer, but it didn't seem very fluid.

any help would be greatly appreciated. I tried a bunch of stuff in here so alot of the junk can go away. I just want it to look neat and professional and not have any alignment issues.


<EditFormSettings EditFormType="Template">
<EditColumn FilterControlAltText="Filter EditCommandColumn column"
        UniqueName="EditCommandColumn1"></EditColumn>
    <FormTemplate>
    <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none"
                        style="border-collapse: collapse; background: white;">
                        <tr class="EditFormHeader">
                            <td style="font-size: small">
                                <b>Employee Details</b>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <b>Officer Info:</b>
                            </td>
                        </tr>
                        
 
   <tr>
        <asp:Label ID="Label1" runat="server" Text="First Name:"></asp:Label>
        <asp:TextBox ID="TextBox1" runat="server" CssClass="txtbox" Text='<%# Bind("emp_Fname") %>'></asp:TextBox>
        <asp:Label ID="Label6" runat="server" Text="ID Num:"></asp:Label>
        <asp:TextBox ID="TextBox5" runat="server" CssClass="txtbox" Text='<%# Bind("emp_IdNum") %>'></asp:TextBox>
   </tr>
   <tr>    
        <asp:Label ID="Label3" runat="server" Text="Last Name:"></asp:Label>
        <asp:TextBox ID="TextBox2" runat="server" CssClass="txtbox" Text='<%# Bind("emp_Lname") %>'></asp:TextBox>
        <asp:Label ID="Label8" runat="server" Text="Classification"></asp:Label>
        <asp:TextBox ID="TextBox7" runat="server" CssClass="txtbox" Text='<%# Bind("emp_class") %>'></asp:TextBox>
   </tr>
       </table>
      <tr>
      <td>
        <asp:Label ID="Label4" runat="server" Text="Race:"></asp:Label>
        <asp:TextBox ID="TextBox3" runat="server" Height="21px"
            style="margin-left: 51px" Text='<%# Bind("emp_Race") %>'></asp:TextBox>
        </td>
      </tr>
      <tr>
      <td>
        <asp:Label ID="Label5" runat="server" Text="Sex"></asp:Label>
          :<asp:TextBox ID="TextBox4" runat="server" Height="21px"
            style="margin-left: 62px" Text='<%# Bind("emp_Sex") %>'></asp:TextBox>
</td>
      </tr>
      <tr>
      <td>
          <asp:Label ID="Label7" runat="server" Text="DOB:"></asp:Label>
          <asp:TextBox ID="TextBox6" runat="server" Height="21px"
              style="margin-left: 56px" Text='<%# Bind("emp_DOB") %>'></asp:TextBox>
</td>
      </tr>
      <tr>
      <td>
           </td>
      </tr>
      <tr>
      <td>
        <asp:Label ID="Label9" runat="server" Text="Email Address"></asp:Label>
        <asp:TextBox ID="TextBox8" runat="server" Height="21px"
            style="margin-left: 18px" Text='<%# Bind("emp_Email") %>'></asp:TextBox>
        <asp:Label ID="Label10" runat="server" Text="Street Address"></asp:Label>
        <asp:TextBox ID="TextBox9" runat="server" Height="21px"
            style="margin-left: 18px" Text='<%# Bind("emp_StreetAdd") %>'></asp:TextBox>
        <asp:Label ID="Label11" runat="server" Text="City"></asp:Label>
        <asp:TextBox ID="TextBox10" runat="server" Height="21px"
            style="margin-left: 18px" Text='<%# Bind("emp_City") %>'></asp:TextBox>
        <asp:Label ID="Label12" runat="server" Text="Zip"></asp:Label>
        <asp:TextBox ID="TextBox11" runat="server" Height="21px"
            style="margin-left: 18px" Text='<%# Bind("emp_Zip") %>'></asp:TextBox>
        <asp:Label ID="Label13" runat="server" Text="Hire Date"></asp:Label>
        <asp:TextBox ID="TextBox12" runat="server" Height="21px"
            style="margin-left: 18px" Text='<%# Bind("emp_HireDate") %>'></asp:TextBox>
        <asp:Label ID="Label14" runat="server" Text="Class Date"></asp:Label>
        <asp:TextBox ID="TextBox13" runat="server" Height="21px"
            style="margin-left: 18px" Text='<%# Bind("emp_classDate") %>'></asp:TextBox>
        <asp:Label ID="Label15" runat="server" Text="Grant Position"></asp:Label>
        <asp:TextBox ID="TextBox14" runat="server" Height="21px"
            style="margin-left: 18px" Text='<%# Bind("emp_GrantPost") %>'></asp:TextBox>
         <asp:Label ID="Label17" runat="server" Text="Inactive"></asp:Label>   
         <asp:CheckBox ID="CheckBox1" runat="server"
                        Checked='<%# Bind("emp_Inactive") %>' />
        <asp:Label ID="Label16" runat="server" Text="Reason Inactive"></asp:Label>
        <asp:TextBox ID="TextBox15" runat="server" Height="21px"
            style="margin-left: 18px" Text='<%# Bind("emp_ReasonInactive") %>'></asp:TextBox>
         
            <tr>
                            <td align="right">
                                <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                    runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                                </asp:Button
<asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
CommandName="Cancel"></asp:Button>
                            </td>
                        </tr>
         
        
         
    </FormTemplate>
</EditFormSettings>



Dave
Top achievements
Rank 1
 answered on 06 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?