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

I am trying to enable basic filtering option in Radgrid but the filtering option is not working. The text-box for filter is coming up but while clicking the filter button the context menu is not coming and the filter is also not working . The grid and the SQL Datasource is given bellow. Other function of the grid is working.

<telerik:RadGrid ID="RadGrid3" runat="server" AllowAutomaticDeletes="True" 
                            AllowAutomaticInserts="True" AllowAutomaticUpdates="True" EnableHeaderContextMenu="true" EnableHeaderContextFilterMenu="true"
                            DataSourceID="SqlMenuGrp" GridLines="None" AllowFilteringByColumn="true" AllowSorting="True" AllowPaging="true" PageSize="30" 
                            AutoGenerateColumns="False" Width="800" Skin="Outlook" >
                  
                        <MasterTableView DataSourceID="SqlMenuGrp" EnableHeaderContextMenu="true" AllowFilteringByColumn="true" CommandItemDisplay="TopAndBottom" 
                         AutoGenerateColumns="False" DataKeyNames="Menu_Txn_ID">
                         <EditFormSettings>
                                        <EditColumn CancelImageUrl="../image/RadControls/Grid/Skins/Default/Cancel.gif" EditImageUrl="../image/RadControls/Grid/Skins/Default/Edit.gif"
                                            InsertImageUrl="../image/RadControls/Grid/Skins/Default/Insert.gif" UniqueName="EditCommandColumn"
                                            UpdateImageUrl="../image/RadControls/Grid/Skins/Default/Update.gif">
                                        </EditColumn>
                                    </EditFormSettings>
                          
                            <Columns>
                                <telerik:GridEditCommandColumn  ButtonType="ImageButton" UniqueName="EditCommandColumn">
                                </telerik:GridEditCommandColumn>
                                <telerik:GridBoundColumn DataField="Menu_Txn_ID" DataType="System.Int32" ReadOnly="True" UniqueName="Menu_Txn_ID" Visible="false" ></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Menu_Ref_Name" HeaderText="Menu Ref Name" UniqueName="Menu_Ref_Name" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" ShowFilterIcon="false"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Menu_Ref_ID" HeaderText="Menu Ref ID" UniqueName="Menu_Ref_ID"></telerik:GridBoundColumn>
                                <telerik:GridDropDownColumn DataSourceID="SqlMenuDetails" SortExpression="Menu_ID" ListTextField="Menu_Text" ListValueField="Menu_ID" UniqueName="Menu_ID" DataField="Menu_ID" DropDownControlType="DropDownList" HeaderText="Menu Name"></telerik:GridDropDownColumn>
                                

                            </Columns>
                            <EditFormSettings ColumnNumber="2" CaptionDataField="Menu_Ref_Name" CaptionFormatString="Edit <h6> {0} </h6>">
                                <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                                <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White" Width="100%" />
                                <FormTableStyle CellSpacing="0" CellPadding="2" Height="80px" BackColor="White" />
                                <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                                <EditColumn ButtonType="ImageButton" InsertText="Insert" UpdateText="Update record"
                                            UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                                 </EditColumn>
                                 <FormTableButtonRowStyle HorizontalAlign="Right"></FormTableButtonRowStyle>
                            </EditFormSettings>
            
                        </MasterTableView>
                        <ClientSettings>
                                <ClientEvents OnRowDblClick="RowDblClick" />
                        </ClientSettings>

                    </telerik:RadGrid>
                 </div>
            </div>

            <asp:SqlDataSource ID="SqlMenuGrp" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConStr %>" 
                    SelectCommand="Select * from UR_Txn_Menu_User_Group ORDER BY Menu_Ref_Name"  
                    UpdateCommand="UPDATE UR_Txn_Menu_User_Group SET [Menu_ID] = @Menu_ID, [Menu_Ref_ID] = @Menu_Ref_ID, Menu_Ref_Name = @Menu_Ref_Name WHERE Menu_Txn_ID = @Original_Menu_Txn_ID"
                    InsertCommand="INSERT INTO [UR_Txn_Menu_User_Group] ([Menu_ID],[Menu_Ref_ID],[Menu_Ref_Name]) VALUES ( @Menu_ID,Menu_Ref_ID, UPPER(@Menu_Ref_Name))"
                     DeleteCommand="UPDATE UR_Txn_Menu_User_Group WHERE Menu_Txn_ID = @Original_Menu_Txn_ID"
                  OldValuesParameterFormatString="original_{0}" ConflictDetection="CompareAllValues">
                    <UpdateParameters>
                        <asp:Parameter Name="Original_Menu_Txn_ID" Type="Int32" />
                        <asp:Parameter Name="Menu_ID" Type="Int32" />
                        <asp:Parameter Name="Menu_Ref_ID" Type="Int32" />
                        <asp:Parameter Name="Menu_Ref_Name" Type="String" />
                     
                    </UpdateParameters>
                    <InsertParameters>
                        <asp:Parameter Name="Original_Menu_Txn_ID" Type="Int32" />
                        <asp:Parameter Name="Menu_ID" Type="Int32" />
                        <asp:Parameter Name="Menu_Ref_ID" Type="Int32" />
                        <asp:Parameter Name="Menu_Ref_Name" Type="String" />
                   
                    </InsertParameters>
                  <DeleteParameters>
                        <asp:Parameter Name="Original_Menu_Txn_ID" Type="Int32" />
                    </DeleteParameters>
                 </asp:SqlDataSource>

                <asp:SqlDataSource ID="SqlMenuDetails" runat="server"
                 ConnectionString="<%$ ConnectionStrings:ConStr %>" 
                    SelectCommand="Select * from UR_Menu_Details WHERE Is_Enabled ='Y'" >
                </asp:SqlDataSource>

Konstantin Dikov
Telerik team
 answered on 29 Dec 2014
1 answer
75 views
Hello! There is an anomaly with date January 1st 2014. If you choose it or write it in RadDatePicker text field it will be switched to February 1st 2013. This problem appears only in Firefox. What can i do with this? Screencast of this process: http://screencast.com/t/6BKGbzzJVxCm
I use Telerik.Web.UI version 2014.2.724.40.
Konstantin Dikov
Telerik team
 answered on 29 Dec 2014
3 answers
316 views
I am trying to construct something similar to (but different from) one of your demos located in https://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window , but am having issues.

When I follow (or at least think I am following) the demo code and reproduce it as best I can for my use, the template column always comes up disabled somehow and there is no activity when I click on it. A screen capture of the resulting grid is attached.

My applicable code is shown in the snippets below.  Any pointers you can give me would be appreciated.  Obviously I've gotten something really wrong.  The object of my code is to create a column that, when clicked, executes a javascript function called enterit(recno) but right now the code is trying to execute the ShowEditForm function (but I don't really want it to display an edit form within the grid).

Javascript functions are:
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function enterit(recno) {
                document.getElementById('<%= K.ClientID%>').value = recno;
                document.getElementById('<%= KI.ClientID%>').value = recno;
                document.getElementById('<%= KII.ClientID%>').value = recno;
                document.getElementById('<%= M.ClientID%>').value = "Y";
                document.getElementById('<%= MI.ClientID%>').value = "N";
                document.getElementById('<%= MII.ClientID%>').value = "N";
                document.forms["form1"].submit();
            }
 
            function makeNew(sender, eventArgs) {
                document.getElementById('<%= HiddenField1.ClientID%>').value = "myTarget;
                document.getElementById('<%= K.ClientID%>').value = "0";
                document.getElementById('<%= KI.ClientID%>').value = "0";
                document.getElementById('<%= KII.ClientID%>').value = "0";
                document.getElementById('<%= M.ClientID%>').value = "N";
                document.getElementById('<%= MI.ClientID%>').value = "N";
                document.getElementById('<%= MII.ClientID%>').value = "N";
                document.forms["form1"].submit();
            }
 
            function ShowEditForm(id, rowIndex) {
                var grid = $find("<%= RadGrid1.ClientID %>");
                var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
                grid.get_masterTableView().selectItem(rowControl, true);
                alert("My row's id value=" + id);
                //window.radopen("EditForm_csharp.aspx?EmployeeID=" + id, "UserListDialog");
                return false;
            }
 
        </script>
    </telerik:RadCodeBlock>
</asp:Content>

The grid/template column is defined as:
<telerik:RadGrid ID="RadGrid1" runat="server" Width="99.7%" AutoGenerateColumns="false" AllowPaging="false">
                <MasterTableView AutoGenerateColumns="False" DataKeyNames="MAB" ClientDataKeyNames="MAB" Width="100%" >
                    <Columns>
 
                        <telerik:GridTemplateColumn UniqueName="TemplateEditColumn">
                            <ItemTemplate>
                                    <asp:HyperLink ID="EditLink" runat="server" Text="Edit"></asp:HyperLink>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

The RadGrid1_ItemCreated is:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        HyperLink editLink = (HyperLink)e.Item.FindControl("EditLink");
        editLink.Attributes["href"] = "javascript:void({0});";
        editLink.Attributes["onclick"] = String.Format("return ShowEditForm('{0}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["MAB"], e.Item.ItemIndex);
    }
}

The grid is programmatically defined in Page_Init as shown below.  Please ignore the hypercolumn defined programmatically -- that is what I trying NOT to use.  I just haven't removed it yet.

protected void Page_Init(object sender, System.EventArgs e)
{
        GridHyperLinkColumn hypercolumn = null;
        GridBoundColumn boundcolumn = null;
        GridTemplateColumn tempcolumn = null;
 
        RadGrid1.EnableViewState = false;
        RadGrid1.NeedDataSource += new Telerik.Web.UI.GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource);
 
        RadGrid1.ID = "RadGrid1";
        RadGrid1.PageSize = 15;
        RadGrid1.AllowPaging = true;
        RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;
        RadGrid1.AutoGenerateColumns = false;
        RadGrid1.AllowFilteringByColumn = false;
        RadGrid1.ExportSettings.ExportOnlyData = true;
        RadGrid1.ExportSettings.IgnorePaging = true;
        RadGrid1.ExportSettings.HideStructureColumns = true;
        RadGrid1.ExportSettings.OpenInNewWindow = true;
        RadGrid1.MasterTableView.CommandItemSettings.ShowExportToCsvButton = false;
        RadGrid1.MasterTableView.CommandItemSettings.ShowExportToExcelButton = false;
        RadGrid1.MasterTableView.CommandItemSettings.ShowExportToPdfButton = false;
        RadGrid1.MasterTableView.CommandItemSettings.ShowExportToWordButton = false;
        RadGrid1.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = false;
        RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
 
        RadGrid1.MasterTableView.DataKeyNames = new string[] { "MAB" };
 
        hypercolumn = new GridHyperLinkColumn();
        hypercolumn.HeaderText = "Edit";
        hypercolumn.UniqueName = "MAB";
        hypercolumn.Text = "<img border=\"0\" alt=\"View\" src=\"../Icons/pencil_16.png\" />";
        hypercolumn.DataNavigateUrlFields = new string[] { "MAB" };
        hypercolumn.DataNavigateUrlFormatString = "OfcMABEdit.aspx?M=Y&K=" + "{0}";
        RadGrid1.MasterTableView.Columns.Add(hypercolumn);
 
        boundcolumn = new GridBoundColumn();
        this.RadGrid1.Columns.Add(boundcolumn);
        boundcolumn.UniqueName = "MABName";
        boundcolumn.DataField = "MABName";
        boundcolumn.HeaderText = "Name";
        boundcolumn.Visible = true;
        boundcolumn = null;
 
        RadGrid1.AllowPaging = Convert.ToBoolean(Session["ShowListsWithPaging"]);
 
 
}

I think that is all the affected code should need to see.  If there's anything else, please let me know.  Sorry to be a pain!

Thanks in advance!

Lynn








Konstantin Dikov
Telerik team
 answered on 29 Dec 2014
7 answers
70 views
I'm getting the following errors for RadEditor in IE for Windows Phone, but not on any other platform as far as I can tell:

Error while executing filter FixUIBoldItalic - TypeError: Unable to get property 'getElementsByTagName of undefined or null reference

and

Error while executing filter ConvertFontToSpanFilter - TypeError: Unable to get property 'ownerDocument' of undefined or null reference

Thoughts?
Ianko
Telerik team
 answered on 27 Dec 2014
3 answers
164 views
I have CommandItemSettings-ShowRefreshButton="false" settings in MasterTableView and it works fine. However it doesn't apply to hierarchical grid beneath it.
Is there equivalent of MasterTableView for sub table? Or any other way to achieve the objective

Happy Holidays to everybody and thank you
David
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 26 Dec 2014
1 answer
49 views
Hi,

I use RadSpell for spelling check control, it works fine when the text is small, but when the text content is large, for example 30k+ lines, an error page pop up:

Spell check handler server error: 500
...
<title>...The length of the string exceeds the value set on the maxJsonLength property.</title>
...

I use client JS method startSpellCheck();  and set source text when I click a button.

And I also set the maxJsonLength to a big value, but it seems that the spell check ignore it:

<system.web.extensions>
    <scripting>
      <webServices>       
        <jsonSerialization maxJsonLength="2147483644"></jsonSerialization>
      </webServices>
    </scripting>
  </system.web.extensions>

Konstantin Dikov
Telerik team
 answered on 26 Dec 2014
1 answer
63 views
Hi,

I use RadSpell for spelling check control, it works fine when the text is small, but when the text content is large, for example 30k+ lines, an error page pop up:

Spell check handler server error: 500
...
<title>...The length of the string exceeds the value set on the maxJsonLength property.</title>
...

I use client JS method startSpellCheck();  and set source text when I click a button.

And I also set the maxJsonLength to a big value, but it seems that the spell check ignore it:

<system.web.extensions>
    <scripting>
      <webServices>       
        <jsonSerialization maxJsonLength="2147483644"></jsonSerialization>
      </webServices>
    </scripting>
  </system.web.extensions>
Konstantin Dikov
Telerik team
 answered on 26 Dec 2014
1 answer
46 views
Hi,

I use RadSpell for spelling check control, it works fine when the text is small, but when the text content is large, for example 30k+ lines, an error page pop up:

Spell check handler server error: 500
...
<title>...The length of the string exceeds the value set on the maxJsonLength property.</title>
...

I use client JS method startSpellCheck();  and set source text when I click a button.

And I also set the maxJsonLength to a big value, but it seems that the spell check ignore it:

<system.web.extensions>
    <scripting>
      <webServices>       
        <jsonSerialization maxJsonLength="2147483644"></jsonSerialization>
      </webServices>
    </scripting>
  </system.web.extensions>
Konstantin Dikov
Telerik team
 answered on 26 Dec 2014
1 answer
90 views
Hi ,

Do we have 'DoesNotStartWith' and 'DoesNotEndWith' operators in RadFilter?
 
Regards,
Vijendra.
Daniel
Telerik team
 answered on 26 Dec 2014
4 answers
295 views
Hello,
    I want to add Google places autocomplete feature in batch edit cell. Any ideas to accomplish this?

Here is the code for adding autocomplete feature in a textbox :
var searchTxt = (document.getElementById("textboxid"));
            var searchBox = new google.maps.places.SearchBox(searchTxt);
            google.maps.event.addListener(searchBox, 'places_changed', function()
 { // any action
 });
also to include this
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=places"></script>
Konstantin Dikov
Telerik team
 answered on 26 Dec 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?