Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
80 views
I use a FilterTemplate (RadCombobox) in a RadGrid.
<EventOn:EventManagerGridTemplateColumn DataField="StatusType" UniqueName="StatusType" InterfaceMessageType="EventManagerGridHeaderStatusType" SortExpression="StatusType">
    <HeaderStyle Width="70px" />
    <FilterTemplate>
      <EventOn:EventManagerTypeFilterDropDown ID="ddStatusType" runat="server" EnumType="StatusType" CssClass="FormDropDown" Width="70px"
        DataValueField="StatusType" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("StatusType").CurrentFilterValue %>'
        OnClientSelectedIndexChanged="StatusTypeIndexChanged"/>
 
        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
 
            <script type="text/javascript">
                function StatusTypeIndexChanged(sender, args) {
                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                    tableView.filter("StatusType", args.get_item().get_value(), "EqualTo");
                }
            </script>
 
        </telerik:RadScriptBlock>
    </FilterTemplate>
    <ItemStyle Width="50px" HorizontalAlign="Left" VerticalAlign="Top"></ItemStyle>
    <ItemTemplate>                           
         <EventOn:EventManagerTypeIcon ID="EventOnTypeIcon3" runat="server" Value='<%# Eval("StatusType")%>'></EventOn:EventManagerTypeIcon>
    </ItemTemplate>
</EventOn:EventManagerGridTemplateColumn>

I receive the following exception when filtering the column.
Runtime-fout Microsoft JScript: Sys.WebForms.PageRequestManagerServerErrorException: Neither of the types 'String' and 'StatusType' converts to the other

What am i doing wrong?

Dick
Top achievements
Rank 1
 asked on 30 Nov 2011
1 answer
81 views
OK. I know I can do this using the .add_close() method on the client-side event.

However, I need to add the function in such a way as to allow me to access objects from the calling functio9n in the callback function. So, I have something like this...
function ProcessToolTipAction(action, ID)
{
    if (action == "<%= GlobalConstants.CommandName.REQUESTINVITE %>")
    {
        var wnd = $find('<%=winInviteSelf.ClientID %>');
        wnd.add_close(function (sender, e)
        {
            var args = e.get_argument();
            if (IsDialogResultOK(args))
            {
                AjaxRequestObject = GetAjaxRequestObject(action, "<%=this.GetType().ToString()%>");
                AjaxRequestObject.AppointmentId = ID;
                AjaxRequestObject.HideInvite = args.HideInvite;
                AjaxRequestObject.SpecialNotes = args.SpecialNotes;
                AjaxRequestJson(AjaxRequestObject);
            }
        });
        wnd.show();
    }
}
And this seems to work just fine.

Except.

The server-size code, invoked by my AjaxRequestJson() call is executed multiple times if the window is opened multiple times.

Now, if I were doing this in the more traditional way (with the callback function being a standalone function) I'd just call remove_close(functionname) in the callback function itself.

So, to the question: what do I pass to the remove_close() function to prevent multiple copies of the nested function from being called?

--
Stuart
Stuart Hemming
Top achievements
Rank 2
 answered on 30 Nov 2011
1 answer
188 views
Hi,

I need to prevent open window for files in radfileexplorer.Instead of these I am using save process in "Open" menu option.
Please send me exact code to disable open file window without remove open option in context menu.

Regards,
Praveen
Dobromir
Telerik team
 answered on 30 Nov 2011
4 answers
250 views
I'm trying to use RadAlert in my .Net 4.0 web form/app and have found that trying to display certain text makes the window fail to appear.
I was trying to put a html table in mine and when I do the alert doesn't ever show up when called. Using the same code I can make the window display with no html tags involved. From what I have read html should be allowed, right?

If my message is "Testing 123" the window pops up.

If my message is a html table, the window doesn't pop up, like this:
"<table>
    <tr>
        <td>
            Label:
        </td>
        <td>
            Value
        </td>
    </tr>
</table>"

But a simpler html snippet like this does pop up:
Label:   <i>value</i> <br />

Is there a resource that will show me exactly what is or isn't allowed? Or is it a length restriction? Thanks!
Kevin
Top achievements
Rank 2
 answered on 30 Nov 2011
2 answers
185 views
Hello,

I want to add a div to a RadPane. This Div is target of a LoadingPanel because the content of the div is dynamic.

This is the div:
HtmlGenericControl contentDiv = new HtmlGenericControl("div");
contentDiv.Style.Add("width", "100%");
contentDiv.Style.Add("height", "100%");

This is the RadPane:
RadPane pane2 = new RadPane();
pane2.ID = "Pane2";
pane2.Height = new Unit(100, UnitType.Percentage);
pane2.Width = new Unit(100, UnitType.Percentage);
pane2.Controls.Add(contentDiv);

The RadSplitter also has a height of 100%. The parent container has a fixed width.
The height of the RadPanes is ok, but the contentDiv doesn't fill the whole RadPane, because this is rendered:

<div id="RAD_SPLITTER_PANE_CONTENT_Pane2" style="overflow-x: auto; overflow-y: auto; height: 598px; width: 1210px; ">
<div id="ContentPanel1Panel" style="display: block; ">
<div id="ContentPanel1" style="width:100%;height:100%;"></div>

As you can see, the contentDiv produces 2 divs when it gets added to the RadPane. The first div has no width/height set, so the next div doesn't work as expected. What can I do that the automatically generated "ContentPanel1Panel" also has height/width = 100%?

Thanks!
JP
Top achievements
Rank 1
 answered on 30 Nov 2011
4 answers
102 views
Hey,

I'm trying to dynamically create various levels of detail tables for a project I'm working on. I have almost everything working now (in terms of display anyway) thanks to help from this forum, but there's just one more problem. I'm trying to reference the controls in various edit/insert sections but I've hit something of a problem.

At the top level I've added a hardcoded template in the front-end code, like so:
<EditFormSettings EditFormType="Template">
  <EditColumn UniqueName="EditCommandColumn1">
  </EditColumn>
  <FormTemplate>
    <asp:Panel ID="pnlZForm" runat="server">
      <div id="divZEdit">
        <asp:Label ID="lblMerchantCode" Width="150px" runat="server" Text="Merchant Code:" />
        <telerik:RadTextBox ID="rtxtMerchantCode" Runat="server" Width="150px" />
        <br />
        <asp:Label ID="lblAccountName" Width="150px" runat="server" Text="Account Name:" />
        <telerik:RadTextBox ID="rtxtAccountName" Runat="server" Width="150px" />
        <br />
        <asp:Label ID="lblSharedSecret" Width="150px" runat="server" Text="Shared Secret:" />
        <telerik:RadTextBox ID="rtxtSharedSecret" Runat="server" Width="150px" />
        <br />
        <telerik:RadButton ID="btnUpdate" runat="server" Text="Update" />
        <telerik:RadButton ID="btnCancel" runat="server" Text="Cancel" CommandName="Cancel" />
      </div>
    </asp:Panel>
  </FormTemplate>
</EditFormSettings>

Now I can access these controls (or could on Friday when I was trying to get it to work) in the code by trying to access them in the ItemDataBound. However when I tried to create a template, use that for the form instead in the code and then access control from there it no longer seems to work. The code I'm using to assign the template is as follows (cut down for convenience to just the relevant code):
Private Sub rgdNewRadGrid_DetailTableDataBind(ByVal source As Object, ByVal e As GridDetailTableDataBindEventArgs) Handles rgdNewRadGrid.DetailTableDataBind
  Dim dataItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem)
  
  Select Case e.DetailTableView.Name
    Case "myDetailTable"
      Dim myTrackingGUID As Guid = New Guid(dataItem.Item("MerchantTrackingGUID").Text)
      Dim myDataSet As New DataSet
  
      '===Get the DetailTable data===
      myDataSet = *get dataset from database*
  
      e.DetailTableView.DataSource = myDataSet
      e.DetailTableView.CommandItemDisplay = GridCommandItemDisplay.Top
      e.DetailTableView.CommandItemSettings.AddNewRecordImageUrl = "../Img/AddRecord.gif"
      e.DetailTableView.CommandItemSettings.AddNewRecordText = "Add New Details"
      e.DetailTableView.CommandItemSettings.ShowRefreshButton = False
      e.DetailTableView.EditFormSettings.EditFormType = GridEditFormType.Template
      e.DetailTableView.EditFormSettings.FormTemplate = LoadTemplate("Templates/myNewAdd.ascx")
  End Select
End Sub

The code for myNewAdd.ascx is just simply as follows, and it DISPLAYS absolutely fine on the form.
<%@ Control Language="VB" ClassName="myNewAdd" %>
<asp:Panel ID="pnlNewForm" runat="server">
  <div id="divNewEdit">
    <asp:Label ID="lblTerminalUserGroupID" Width="150px" runat="server" Text="TerminalUserGroupID:" />
    <telerik:RadComboBox ID="rcbxTerminalUserGroupID" Width="200px" runat="server" />
    <br />
    <telerik:RadButton ID="btnDetailUpdate" runat="server" Text="Update" />
    <telerik:RadButton ID="btnDetailCancel" runat="server" Text="Cancel" CommandName="Cancel" />
  </div>
</asp:Panel>

I'm aware the update button doesn't do anything at the moment, but at the moment I haven't gotten that far quite frankly. I'm more concerned with getting this code to work. So, I set that template as the template and it works, but when I try to access the control it doesn't work. I'm trying to access it in the ItemDataBound. Maybe I'm trying to access things in the wrong order and it's already run ItemDataBound before it's bound the template or something, in which case where do I bind the template? But here's the code I'm trying to use:
Protected Sub rgdNewRadGrid_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgdNewRadGrid.ItemDataBound
  If e.Item.IsInEditMode AndAlso e.Item.OwnerTableView.Name = "myDetailTable" Then
    Dim editItem As GridEditFormItem = e.Item
    Dim rcbxTerminalUserGroupID As RadComboBox = editItem.FindControl("rcbxTerminalUserGroupID")
    Dim myDataSet As Data.DataSet
  
    myDataSet = *get data from database*
  
    For Each row As DataRow In myDataSet.Tables(0).Rows
      Dim myItem As New RadComboBoxItem
      myItem.Text = row.Item("NAME").ToString
      If Not rcbxTerminalUserGroupID Is Nothing Then
        rcbxTerminalUserGroupID.Items.Add(myItem)
      End If
    Next
  End If
End Sub

The reason I have "If Not rcbxTerminalUserGroupID Is Nothing Then" is because I was continuously getting a NullReferenceException because evidently it couldn't find the control, even though the control blatantly displays on the page. Like I said above, I'm going to assume this is because of the way that the RadGrids run the procedures possibly, or something else related to the template, but it's immensely annoying and I really want to get this working.

If anyone can help I'll be massively grateful.
Pete
Top achievements
Rank 1
 answered on 30 Nov 2011
2 answers
130 views
Hello telerik members;

Pease can you help on the below;

I have a grid with an edit item command that loads a user control form like:http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/usercontroleditform/defaultcs.aspx 
I need to close the edit form (user control) when the user clicks back on the edit item command just like clicking cancel button on the user control. 

Best Regards
Amjad
Top achievements
Rank 1
 answered on 30 Nov 2011
2 answers
105 views
Hi there, 

I have an ascx control where I have a timer, a few textboxes and a datagrid in an AJAX panel.

Every 10 seconds, the timer calls a module that builds an SQL query depending on the textboxes given, then fetches the data and binds it to the grid.

My problem is that sometimes it loses its scroll position. It does not necessarily scroll to the top, sometimes it even scrolls to the bottom or middle of the page (This means it is not doing a full page refresh... which is good).

My suspicion is that it scrolls to the control that is focused on.

Anyway to stop this?

Thanks!

K
Kevin Cauchi
Top achievements
Rank 1
 answered on 30 Nov 2011
3 answers
43 views
This was with regards to supporting large data, with radtree and radgrid controls. Do you have any inbuilt virtualization functionality like in silverlight for supporting huge data on the client, or any plans to have it incorporated in future? 
Radoslav
Telerik team
 answered on 30 Nov 2011
1 answer
138 views

Hi,

I have a page with the radgrid ,which is coded as below:

<
telerik:RadGrid ID="rgSchool" ShowGroupPanel="false" ShowStatusBar="true" AllowCustomPaging="true"

            RegisterWithScriptManager="true" runat="server" AutoGenerateColumns="False" AllowSorting="True"

            GridLines="Vertical" OnSortCommand=" rgSchool _SortCommand" AllowMultiRowSelection="False"

            AllowPaging="True" Skin="Vista" OnNeedDataSource=" rgSchool _NeedDataSource"

            OnPageIndexChanged=" rgSchool _PageIndexChanged" OnPageSizeChanged=" rgSchool _PageSizeChanged"

            OnItemDataBound=" rgSchool _ItemDataBound" OnGroupsChanging=" rgSchool _GroupChanging"

            OnColumnHiding=" rgSchool _ColumnHidden">

            <SortingSettings EnableSkinSortStyles="false" />

            <PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="true"></PagerStyle>

            <MasterTableView Width="100%" DataKeyNames="SerialNumber, StudId,Status" ClientDataKeyNames="SerialNumber, StudId,Status"

                AllowMultiColumnSorting="false" EnableHeaderContextMenu="true" AutoGenerateColumns="false"

                TableLayout="auto">

                <Columns>

 

                    <telerik:GridBoundColumn DataField="DateJoin" HeaderText="Date Of Joining" SortExpression="DateReceived"

                        Visible="true" DataFormatString="{0:MM/dd/yyyy}" />

                    <telerik:GridBoundColumn DataField="SerialNumber" HeaderText="Serial #" SortExpression="SerialNumber"

                        Visible="true" DataFormatString="{0:N0}" />

                    <telerik:GridBoundColumn DataField=" StudId " HeaderText="Student ID #" SortExpression=" StudId "

                        Visible="true" />

                    <telerik:GridBoundColumn DataField="Status" HeaderText="Status" SortExpression="Status"

                        Visible="true" />

                    </telerik:GridBoundColumn>

                </Columns>

            </MasterTableView>

            <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true" EnableRowHoverStyle="true">

                <Scrolling AllowScroll="false" SaveScrollPosition="true" UseStaticHeaders="true" />

                <Resizing AllowColumnResize="true" EnableRealTimeResize="false" ResizeGridOnColumnResize="false"

                    ClipCellContentOnResize="false" AllowResizeToFit="true" />

                <Selecting AllowRowSelect="true" />

                <ClientEvents OnRowDblClick="RowDblClick" OnRowSelected="RowSelected" OnRowContextMenu="onRowContextMenu"

                    OnColumnHidden=" rgSchoolColumnHidden" OnColumnShown=" rgSchoolColumnShown" />

            </ClientSettings>

            <HeaderContextMenu EnableScreenBoundaryDetection="true" EnableAutoScroll="true" />

        </telerik:RadGrid>

So,the users can sort,Hide,Group the columns.The sorting of the column will be done in the SP itself,based on the column(header selected).So,From the SP though get the correctly sorted data(i.e., though the DataSource is updated correctly),the grid is not STILL NOT showing the correctly sorted data.Please find the related server side code below :

protected void rgSchool_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)

{

try

{

ViewState["CurrentPageIndex"] = rgSchool.CurrentPageIndex + 1;

 //Getting the sorted,......data through SP.and storing in response object.

  IEnumerable<rgSchoolReadRecord> response = WCFObj.Read(out recordCount, request);

rgSchool.DataSource = null;

rgSchool.DataSource = response;//DataSorce is updating correctly

rgSchool.VirtualItemCount = recordCount;

rgSchool.CurrentPageIndex = request.PageIndex - 1;

WCFObj.Close();

//Set the current paging and sorting in View state

ViewState["CurrentPageIndex"] = request.PageIndex;

ViewState["PageSize"] = request.PageSize;

ViewState["CurrentSort"] = request.OrderBy;

ViewState["SortDescending"] = request.Desc;

ViewState["rgSchoolSearchRequestObjet"] = request;

ViewState["recordCount"] = recordCount;

}}

Antonio Stoilkov
Telerik team
 answered on 30 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?