Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
225 views
Hi,

I am using Telerik RadControls for ASP.NET Ajax.
DLL : Telerik.Web.UI
Version : 2011.2.915.35 

I have a multiview radcalendar with 6 rows and 2 columns.
I need to highlight or change the background of a month based on the user selection in a separate combobox.

I have two questions now,
1. How to identify a particular month in multiview? For eg., if the user selects April 2012, how can i identify this in the calendar?
2. How to set the background color of a particular month? For eg., if the user selects April 2012, how can i identify this in the calendar and change its background? 

Do we have any server-side APIs to achieve this?

PS: I have this radcalendar in an updatepanel. Triggers are set for buttons outside this updatepanel.

Regards,
Dayantihy
Richard
Top achievements
Rank 1
 answered on 02 Mar 2012
2 answers
104 views
Hi,

I'm trying to use a custom filter template with a RadComboBox, which I have been able to do.  I'm now attempting to extend that with the use of checkboxes for multiple selection, however I'm having trouble with the javascript.  The grid and the combo are both created dynamically in code-behind, and doesn't contain any markup.

I have seen some of the examples here, including the one below to find a control:
var combo = $find("<%= RadComboBox1.ClientID %>");

My question really is how to do exactly as above, but using ClientScript.RegisterClientScriptBlock.  Obviously I can't use the markup evalutate functions (<%=) but whenever I try doing $find("RadComboBox.ClientId") I get a null or undefined error.  Any help?

Thanks,
Mathew
Mathew
Top achievements
Rank 1
 answered on 02 Mar 2012
3 answers
119 views
It appears that the ClientSettings.AllowColumnHide setting is not enforced by the HeaderContextMenu. What I mean by this is that when I set AllowColumnHide to false, the Columns menu option still appears in the HeaderContextMenu and the user is still able to hide the columns.

So I was wondering if setting AllowColumnHide to false could work like the Groupable property does on a column. Where, when you set the property to false, that menu option does not appear in the HeaderContextMenu.

This occurs in IE8 with RadControls version 2011.3.1305.35 of the controls.

Thanks,

Kevin
Andrey
Telerik team
 answered on 02 Mar 2012
2 answers
206 views
I have a RadGrid that uses TemplateFields to add/edit data. I use the ItemCommand event to access the Insert command and insert data. I have no issues finding the control in that event, but none of the controls I access have any data.

For example: if I add a new record to the Grid, fill out the text box and click insert; the control is found in the code behind, but the text field is empty, even though I filled out text box. I'm stumped as to why this happens. Below is my code.

ASPX

<telerik:RadGrid ID="ipAddressGridNewDevice" runat="server" AutoGenerateColumns="false" Width="250"
 OnLoad="ipAddressGridNewDevice_OnLoad" OnItemCommand="ipAddressGridNewDevice_ItemCommand" AutoGenerateDeleteColumn="true"
 AutoGenerateEditColumn="true">
    <MasterTableView CommandItemDisplay="Top">
        <Columns>
            <telerik:GridTemplateColumn HeaderText="IP Address">
                <ItemTemplate>
                    <asp:Label ID="newDeviceIP" runat="server" Text='<%# Bind("IPAddress") %>' />
                </ItemTemplate>
                <EditItemTemplate>
                <p>
                    <telerik:RadTextBox ID="newDeviceIP_edit" runat="server" />
                </p>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Attenuation">
                <ItemTemplate>
                    <asp:Label ID="newDeviceAtten" runat="server" Text='<%# Bind("Attenuation") %>' />
                </ItemTemplate>
                <EditItemTemplate>
                    <p>
                        <telerik:RadNumericTextBox ID="newDeviceAtten_edit" runat="server" ShowSpinButtons="true" Width="50px" MinValue="0" Value="0">
                            <NumberFormat DecimalDigits="0" />
                        </telerik:RadNumericTextBox>
                    </p>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
        <CommandItemSettings ShowRefreshButton="false" ShowAddNewRecordButton="true" />
    </MasterTableView>
</telerik:RadGrid>


C#


protected void ipAddressGridNewDevice_ItemCommand(object sender, GridCommandEventArgs e)
        {
           if (e.CommandName == "PerformInsert")
           {
                GridEditFormInsertItem editedItem = e.Item as GridEditFormInsertItem;
                RadTextBox newDeviceIP_edit = (RadTextBox)editedItem.FindControl("newDeviceIP_edit");
                RadNumericTextBox newDeviceAtten_edit = (RadNumericTextBox)editedItem.FindControl("newDeviceAtten_edit");
 
                addIPAddressNewDevice(deviceIPTable, newDeviceIP_edit.Text, (Int32)newDeviceAtten_edit.Value);
                
           }
}
 
William
Top achievements
Rank 1
 answered on 02 Mar 2012
6 answers
394 views
I am using the code you guys have posted on this page = http://www.telerik.com/help/aspnet-ajax/grid-getting-cell-values-for-selected-rows-client-side.html . It works great as long as my column is set to visible = true. when I hide the id column the javascript cannot access the value. Is there a solution to this? Basically what I am doing is allowing the user to select the entire row, I then grab the ID column and send them to a reporting page with this ID set as a querystring.

Here is the aspx page code:

<script type="text/javascript" >
 
    function RowSelected(sender, eventArgs) {
        var grid = sender;
        var MasterTable = grid.get_masterTableView(); var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()];
        var cell = MasterTable.getCellByColumnUniqueName(row, "videoID");
        window.location = "Map.aspx?id=" + cell.innerHTML;
        //here cell.innerHTML holds the value of the cell 
    }
     
</script>
    <style type="text/css" >
       
    .RowMouseOver 
    
      background-color: red !important; 
    
        
    </style>
    <table width="900" align="center">
<tr>
<td>
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
    </telerik:RadScriptManager>
    </td>
</tr>
<tr>
<td align="center">
 
    <telerik:RadGrid ID="RadGrid1"  runat="server"
        AllowPaging="True" DataSourceID="sdsVideoList"
        AllowMultiRowSelection="True" ShowFooter="True" ShowStatusBar="True"
        AllowSorting="True" CellSpacing="0" GridLines="None" Skin="Telerik"
        AutoGenerateColumns="False">
         <ClientSettings EnableRowHoverStyle="true" >
               
              <Selecting AllowRowSelect="true" />
              <ClientEvents OnRowSelected="RowSelected" />
 
            </ClientSettings>
     
<MasterTableView>
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
 
    <Columns>
        <telerik:GridBoundColumn DataField="videoID" Visible="true"
            FilterControlAltText="Filter column column" HeaderText="videoID"
            UniqueName="videoID">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Name"
            FilterControlAltText="Filter column1 column" HeaderText="Name"
            UniqueName="column1">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="CreatedOn"
            FilterControlAltText="Filter column2 column" HeaderText="Date Created"
            UniqueName="column2">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="wisitaID" Visible="false"
            FilterControlAltText="Filter column3 column" HeaderText="Wisita ID"
            UniqueName="column3">
        </telerik:GridBoundColumn>
    </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
</MasterTableView>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
 
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
    </telerik:RadGrid>


Thanks!
Sam
Sam
Top achievements
Rank 1
 answered on 02 Mar 2012
2 answers
219 views
I am using the RadWindow as a dialog for updating some user notes on my database.  I have the RadWindow defined on my main page.  When the user clicks a button, I open the RadWindow and set several field values on the window using Javascript.  The user then enters their data and clicks a "Submit" button.

In the code behind, I am getting the data from the fields on the RadWindow and then calling my database update routine.  The issue I am having is this.  When I pop the window up using Javascript, I am modifying some label, RadTextbox, and Radbutton control text values.  In the code behind I need to use the values. The text values are fine but the labels that I change in the Javascript do not have the updated values in the code behind.  Does anybody know why?

I am using the "OnClientShow" event to call the Javascript routine to modify the RadWindow fields.  Here is the routine:

// This function moves the data from various fields in the carrierinformation page to the data
// update request screen being opened. Some of the fields are actual data fields from the screen
// while others are hidden fields.
function SetDataUpdWindowFields() {
    // Get Carrier name and set.
    var CarrName = GetCarrierName();
    var DUCarrName = document.getElementById("<%= lblDataUpdCarrName.ClientID %>");
    DUCarrName.innerText = CarrName;
    // Get Email Address and Set.
    var EmailAddr = document.getElementById("<%= hfEmailAddr.ClientID %>");
    var DUEmailAddr = $find("<%= rtxtDataUpdEmailAdr.ClientID %>");
    DUEmailAddr.set_value(EmailAddr.value);
    // Set the user notify option to yes.
    $find("<%= roptDataUpdNotifyYes.ClientID %>").set_checked(true);
    $find("<%= roptDataUpdNotifyNo.ClientID %>").set_checked(false);
    // Get and set the location name.
    var rpageview = GetCurrPageView();
    if (rpageview) {
        var lblLocName = $telerik.$(".cdhdr-carrlocationheader", rpageview._element).html();
        if (lblLocName) {
            var DULocName = document.getElementById("<%= lblDataUpdLocName.ClientID %>");
            DULocName.innerText = lblLocName;
        }
    }
}

It is specifically the DUCarrName and DULocName values on the RadWindow that show correctly on the actual window, but do not have the new values in the code behind.

Any help would be greatly appreciated.

Blake
Blake
Top achievements
Rank 1
 answered on 02 Mar 2012
1 answer
81 views
Dear Telerik Team,

Let me know if the following approach would work out.

1) Page.aspx displays a RadGrid with a number of customizations user can  do on it to show the data.
2) Page.aspx has a button called 'Generate PDF'. When I click it, is it possible to create a new instance of RadGrid, assign the existing grid value to it (BYVAL and not BYREF). Then export the PDF from the new instance of RadGrid.

Basically I want to do this because I can not call 'Rebind' on the existing grid and/or visually make any changes on the existing grid. The new grid should be invisible totally only for the purpose of PDF.
Casey
Top achievements
Rank 1
 answered on 02 Mar 2012
3 answers
265 views
Greetings,

I have a GridCheckboxColumn in my grid and a need to create a GridTemplateColumn according to the checkbox is checked or not.
For instance,

line 1,

if the checkbox is checked the GridTempleColumn label displays "YES" ,
if the checkbox is not checked the GridTempleColumn label displays "NO",
if the checkbox is NULL : it displays "N/A".


To sum up, i have this in my aspx page:

<telerik:GridCheckBoxColumn DataField="facturable" DataType="System.Boolean" HeaderText="facturable"
    SortExpression="facturable" UniqueName="facturable">
</telerik:GridCheckBoxColumn>
 
                <telerik:GridTemplateColumn  HeaderText="Type de tickets"
    UniqueName="typedestickets">
    <ItemTemplate><asp:Label id="test" runat="server"></asp:Label></ItemTemplate>
</telerik:GridTemplateColumn>

My try in code behind : ( not working )

protected void RadGrid1_DataBound(object sender, EventArgs e)
{
    foreach (Telerik.Web.UI.GridDataItem dataItem in RadGrid1.MasterTableView.Items)
    {
        CheckBox chkDelete = (CheckBox)dataItem.FindControl("facturable"); 
        Label label = (Label)dataItem.FindControl("test");
 
        if (chkDelete.Checked == true) { label.Text = "MA"; }
    }
 
 
 
}


Thank you in advance for your help

Casey
Top achievements
Rank 1
 answered on 02 Mar 2012
2 answers
122 views
Since I upgraded to Telerki.Web.UI.dll version 2012.1.212.35, disabled RadDateInput controls show two dates.  It happens whether I pre-populate the date using the DbSelectedDate or the SelectedDate property.

 

<telerik:RadDateInput ID="BwrDOB" runat="server" Enabled="false" MinDate="1/1/1900">
</telerik:RadDateInput>

The two date problem appeared when I tested with the following browsers:

  • Internet Explorer 9.0.8112.16421 (update versions 9.0.5)
  • Opera 11.60 Build 1185, Opera 11.61 Build 1250

NOTE:  When I turned on IE compatibility mode, the problem disappeared.

I didn't have any problems with the following browsers:

  • Firefox 10.0.1
  • Google Chrome 16.0.912.77m, Google Chrome 17.0.963.56m
  • Safari 5.1.1 (7534.51.22)
Vasil
Telerik team
 answered on 02 Mar 2012
8 answers
300 views
Hello,

I am using the latest 2011 Ajax .Net version (2011 Q3). Can you please provide an example about how to programmatically create a Rad Alert with custom html text content?
Also, the  Rad Alert should auto-size (if possible?) and I need to control the position of the 'Ok' button.

What I am trying to achieve is to display a modal window (created by code) once I click on some areas of the page. This is necessary because I am pulling information from a database.

Regards,
M.R.
M. R.
Top achievements
Rank 1
 answered on 02 Mar 2012
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?