Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
121 views
Hi --

I have a RadGrid control with EnableHeaderContextMenu="true" on the MasterTableView.  The header context menu works great on initial page load, but after a postback (caused by sorting or any other grid related event), the context menu no longer works.  (After a postback, right-clicking brings up the browser's context menu instead of the RadGrid context menu.)

I do have a RadAjaxManager on my page, and this issue could be related to that.  

Can someone help me figure out what I need to do to make the header context menu work after a postback?  Full markup is below.

Thanks,
Rajeev

----------------------------------------

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="IconResultsDetailsView.ascx.cs" Inherits="OfficeUI.Controls.SearchResults.IconResultsDetailsView" %>
<%@ Register Src="~/Controls/SearchResults/FinalIconImagesInSearchResults.ascx" TagName="FinalIconImagesInSearchResults" TagPrefix="uc" %>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanelIconResultsDetailsView" runat="server" />
 
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadGridIconResults">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGridIconResults" LoadingPanelID="RadAjaxLoadingPanelIconResultsDetailsView" />
                <telerik:AjaxUpdatedControl ControlID="BulkEditDialog" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="BulkEditDialog">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="BulkEditDialog" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
 
<telerik:RadGrid
    ID="RadGridIconResults"
    runat="server"
    AllowFilteringByColumn="True"
    AllowPaging="True"
    AllowSorting="True"
    CssClass="RadGridIconResults GridForIconsTab"
    AllowMultiRowSelection="True"
    EnableHeaderContextMenu="True"
    OnItemDataBound="RadGridIconResults_ItemDataBound"
    OnNeedDataSource="RadGridIconResults_NeedDataSource"
    OnItemCreated="RadGridIconResults_ItemCreated"
    AutoGenerateColumns="False"
    PageSize="200"
    >
 
    <PagerStyle
        Mode="NextPrevAndNumeric"
        Position="TopAndBottom"
        FirstPageImageUrl="/Images/Transparent1x1.png"
        LastPageImageUrl="/Images/Transparent1x1.png"
        PrevPageImageUrl="/Images/Transparent1x1.png"
        NextPageImageUrl="/Images/Transparent1x1.png"
        PrevPageText="< prev"
        NextPageText="next >"
        ShowPagerText="true"
        EnableSEOPaging="true"
        />
 
    <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true" Excel-Format="ExcelML" />
    <ClientSettings>
        <Scrolling AllowScroll="false" />
        <Selecting AllowRowSelect="True" UseClientSelectColumnOnly="True" EnableDragToSelectRows="False" />
    </ClientSettings>
    <GroupingSettings CaseSensitive="false" />
    <MasterTableView DataKeyNames="BugNumber" CommandItemDisplay="Top" UseAllDataFields="True" EnableHeaderContextMenu="true">
        <Columns>
            <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" HeaderText="Select" />
 
            <telerik:GridImageColumn HeaderText="" UniqueName="Parsed" ShowSortIcon="true" ShowFilterIcon="false" Groupable="False" AllowSorting="true" AllowFiltering="false" />
 
            <telerik:GridBoundColumn DataField="BugNumber" HeaderText="Bug #" EmptyDataText="none" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" DataFormatString="<nobr>{0}</nobr>">
                <HeaderStyle Wrap="false" />
            </telerik:GridBoundColumn>
 
        </Columns>
        <RowIndicatorColumn>
            <HeaderStyle Width="20px" />
        </RowIndicatorColumn>
        <ExpandCollapseColumn>
            <HeaderStyle Width="20px" />
        </ExpandCollapseColumn>
    </MasterTableView>
    <ItemStyle Height="45px" BackColor="#EFF3F7" />
    <AlternatingItemStyle Height="45px" />
</telerik:RadGrid>
 
<telerik:RadWindow ID="BulkEditDialog" runat="server"
    Behaviors="Move, Close, Resize" Width="650px" Height="400px" Modal="True"
    Title="Review" VisibleStatusbar="False" OnClientClose="OnClientWindowClose" >
</telerik:RadWindow>
Rajeev
Top achievements
Rank 1
 answered on 08 Aug 2013
8 answers
562 views
I am having trouble setting the default values I want to use for MinDate and MaxDate within the EditItemTemplate of a GridTemplateColumn within a RadGrid. Since this control is nested so deeply, I don't have direct access to it in code-behind, so I wanted to set the MinDate and MaxDate in-line in the page (.aspx) markup.

Here's what I have currently for the GridTemplateColumn (I have omitted the MaxDate for the time being, which would be set to the current date, i.e. DateTime.Today):

<telerik:GridTemplateColumn DataField="ScheduleDate" HeaderButtonType="None" 
    HeaderText="Day" SortExpression="ScheduleDate" UniqueName="ScheduleDate">
    <EditItemTemplate>
        <asp:Label ID="Label_ScheduleDate" runat="server" AssociatedControlID = "RadDatePicker_ScheduleDate"></asp:Label>
        <telerik:RadDatePicker ID="RadDatePicker_ScheduleDate" UniqueName="RadDatePicker_ScheduleDate" runat="server" Width="80px" 
            Skin="Outlook" MinDate='<%= System.DateTime.Today().AddDays(-30) %>'>
            <DateInput onclick="$find('<%= RadDatePicker_ScheduleDate.ClientID %>').showPopup();">
            </DateInput>
            <Calendar DayNameFormat="FirstTwoLetters" FirstDayOfWeek="Default">
            </Calendar>
            <DatePopupButton Visible="true" />
        </telerik:RadDatePicker>
    </EditItemTemplate>
    <ItemTemplate>
        <asp:Label ID="ScheduleDateLabel" runat="server" 
            Text='<%# Eval("ScheduleDate", "{0:d}") %>'></asp:Label>
    </ItemTemplate>
</telerik:GridTemplateColumn>

In the Visual Studio 2008 designer, I get an error from the parser:

"Error Creating Control - RadGrid_StaffBreakout: Cannot create an object of type 'System.DateTime' from its string representation '<%= System.DateTime.Today().AddDays(-30) %>' for the 'MinDate' property."

According to the MSDN documentation, this returns a DateTime structure (not an object, since DateTime is a value type). I tried several work arounds like using ToString() and also combining ToString with DateTime.Parse, but none of these worked.

How can I set the MinDate and MaxDate values in the mark-up of the page?

I am using "RAD Controls for ASP.NET AJAX Q2 2010 - SP2"

Thanks,

Jon
Kiran
Top achievements
Rank 1
 answered on 08 Aug 2013
16 answers
386 views
Sir
I called radgrid.rebind() in linkbutton click.But the needdatasource event of that grid is not firing.Any help..
The aspx code is

<telerik:RadDock runat="server" ID="rddockPrjTypes" Title="Project Types">
<
ContentTemplate>
<telerik:RadGrid runat="server" ID="grdProjectTypes" Skin="Vista" AutoGenerateColumns="False"CssClass="gridnew" GridLines="None" ShowHeader="false">
<
ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">

 <Selecting AllowRowSelect="True" />
</
ClientSettings>
<
MasterTableView NoDetailRecordsText="" NoMasterRecordsText="">
<
Columns>
<
telerik:GridTemplateColumn UniqueName="TemplateColumn">                                <ItemTemplate>

<asp:LinkButton ID="lnkPTypes" runat="server" Text='<%#DataBinder.Eval(Container,"DataItem.projecttypedesc") %>'></asp:LinkButton> (<asp:LinkButton ID="lnkCount" runat="server" Text='<%#DataBinder.Eval(Container,"DataItem.counts") %>'></asp:LinkButton>                                                             ) </ItemTemplate>
</
telerik:GridTemplateColumn>

  </Columns>
<
EditFormSettings>
<
PopUpSettings ScrollBars="None"></PopUpSettings>                            </EditFormSettings><ExpandCollapseColumn Visible="False" Resizable="False"><HeaderStyle Width="20px"></HeaderStyle></ExpandCollapseColumn>            </MasterTableView></telerik:RadGrid> </ContentTemplate></telerik:RadDock>

thanks

Sharmin
Top achievements
Rank 1
 answered on 08 Aug 2013
2 answers
2.9K+ views
It work fine on my computer, but when i deploy to server it show error

Parser Error Message: Unknown server tag 'telerik:RadScriptManager'.

Line 39: <body>
Line 40: <form id="form1" runat="server">
Line 41: <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
Line 42: </telerik:RadScriptManager> Line 43: <div>

Please advise.

Thank
Tim
Top achievements
Rank 1
 answered on 08 Aug 2013
2 answers
193 views
I have a radwindow in which I have a button execute some javascript which manipulates the css classes of some elements. I see that this works, but then the content posts back and refreshes and the changes that the javascript just made get wiped out. How can I stop the radwindow from reloading after I execute a javascript function?

Here is the code for the button on the page loaded in the RadWindow:
<div style="padding:10px 10px 10px 10px; position:fixed; background-color:white; width:100%; z-index:100; height:15px;">
    <table>
             <tr>
                <td>
                    <button id="btnModify" onclick="ShowModify(); return false;">Modify</button>
                </td>
             </tr>
  </table>
</div>


And here's the javascript I have in the RadWindow:
function ShowModify()
{
        var elems = document.getElementsByTagName("span");
        for (i in elems)
        {
             if (elems[i].className == "modifyField")
             {
                  elems[i].className = "modifyFieldVisible";
             }
         }
         return false;
}
Gary
Top achievements
Rank 1
 answered on 08 Aug 2013
2 answers
78 views
This is a rather vague question.  I have a classic join table situation.  I put a key from table A and a key from Table B in a join table.  The join table record either exists or it doesn't exist.  If it does exist another process selects the records from table A and B.  (This is a one to many situation.)

My concern is this.  I already have a working solution for this.  I have a popup in the screen for editing table A that creates/deletes join table records for a particular Table A record.  

The popup screen consists of a RadGrid with table B records and a checkbox for each record.  The grid loads from a view that loads all table B records and whether or not a join exists for them with Table A (to set the check boxes.)  Once displayed the users can check or uncheck boxes as they please.  When the Save button is hit, the codebehind adds/deletes join table records as needed. 

This works fine so far but I'm just wondering that if table B grows to some hundreds of records, this might become cumbersome.  I believe it would be simple to 'Ajaxify' the situation so that adds/deletes take place the instant the box is clicked but on the other hand I wonder if I need to maintain a user interface in which changes only take place as a whole.

Suggestions?
Boris
Top achievements
Rank 1
 answered on 08 Aug 2013
6 answers
340 views
I tried to browse thru various form but I couldn't find how to add custom validator to GridNumeric column

I need to have clientside validation and server side validation for gridnumeric columns

I have 4 columns ( Grid Numeric columns) and total column and I need to make sure the total of this cannot be less than zero

I tried to do this in  Item created event , but not successfull
<telerik:GridNumericColumn DataField="AMT1" UniqueName="AMT1" HeaderText="Amount1"

DataType="System.Int32" DataFormatString="{0:N0}" DecimalDigits="0" 

 

ForceExtractValue="Always" SortExpression="Amount1" AllowFiltering="false" EmptyDataText="0"

 

Aggregate="Sum" FooterAggregateFormatString="{0:c0}" FooterStyle-HorizontalAlign="Right" >

 

</telerik:GridNumericColumn>

 

Item created event

If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then

Dim edititem As GridEditableItem = CType(e.Item, GridEditableItem)

For Each GridColumn As GridColumn In edititem.OwnerTableView.Columns

If GridColumn.IsEditable Then

Dim editor As GridNumericColumnEditor = TryCast(edititem.EditManager.GetColumnEditor(GridColumn.UniqueName), GridNumericColumnEditor)

If editor IsNot Nothing Then ' This is mainly to skip the other type of columns and read only numeric columns

 

Dim cell As TableCell = CType(editor.NumericTextBox.Parent, TableCell)

 

Dim validator As CustomValidator = New CustomValidator

validator.ErrorMessage = "Total should be >0"

validator.Display = ValidatorDisplay.Dynamic

 

validator.ForeColor = Drawing.Color.DarkRed

validator.ControlToValidate =""

validator.ValidationGroup = "total"

validator.ClientValidationFunction =

"validatetotal"

cell.Controls.Add(validator)

 

End If

End If

Next

End If


--------------------------------------------------


I am not even seeing the "OnServerValidate" Property.


Please suggest a solution

Thanks


MRa
Top achievements
Rank 1
 answered on 08 Aug 2013
1 answer
170 views
Hello,
I have a Pie Chart whose slice names can be very long - so long that the legend ends up disproportionately large as compared to the actual pie. Is it possible to have the HtmlChart legend only display the first n characters in the category value and then display the full value in the htmlchart tooltip?
Danail Vasilev
Telerik team
 answered on 08 Aug 2013
3 answers
188 views
I have a RadCombo and I am parsing a list of sites {SiteName, SiteUID} in javascript and adding them to the radCombo..
The comboSiteList Object contains a list of Sites with a count of 300...  The javascript function seems to be running very slow.. Is there something below I can do to speed things up?
var siteCombo = $find("<%= RadComboBoxTransferSites.ClientID %>");
          var comboSiteList = transferCountsObject.SiteLists;
          for (var i = 0; i < comboSiteList.length; i++) {
            var comboItem = new Telerik.Web.UI.RadComboBoxItem();
            comboItem.set_text(comboSiteList[i].SiteName.toString());
            comboItem.set_value(comboSiteList[i].SiteUID.toString());
            siteCombo.trackChanges();
            siteCombo.get_items().add(comboItem);
          }
siteCombo.commitChanges();

Wired_Nerve
Top achievements
Rank 2
 answered on 08 Aug 2013
4 answers
152 views
Hello,

The first combobox below behaves as I would expect to, and resizes when the browser window is resized.  However, the second combobox does not resize when the browser window does.  They use the same skin.  The only real difference that I can see is that I use check boxes in the second one.  Is there some way I can get it to resize when the browser window does (even if it is somehow done with javascript)?  This is pretty important functionality for my customer...

Any help would be greatly appreciated!

<telerik:RadComboBox ID="ShapesRadComboBox" runat="server" Skin="SST_Touch"
    SkinID="SST_Touch" EnableEmbeddedSkins="False" AllowCustomText="false"
    ShowDropDownOnTextboxClick="true" Width="100%" />
 
<telerik:RadComboBox ID="FillMaterialRadComboBox" runat="server" Skin="SST_Touch"
    SkinID="SST_Touch" EnableEmbeddedSkins="False" AllowCustomText="false"
    CheckBoxes="True" EnableCheckAllItemsCheckBox="True"
    ShowDropDownOnTextboxClick="true" CheckedItemsTexts="DisplayAllInInput"
    Width="100%" />
Ivan Zhekov
Telerik team
 answered on 08 Aug 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?