Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
142 views
Hello,

I am working on a project with RadGrid.
I'm trying to implement a filter like the following example:
Filtering with Client-Side Binding

I want the Grid values to change according to the text which the user is typing in the filter Textbox.
In my Project I use a DataTable as a data source.

How can I do this?

My code:
01.Public Class Grid_Filter_Client
02.    Inherits System.Web.UI.Page
03.    Dim dd As New DummyData
04.    Dim dt As New DataTable
05.    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
06. 
07.        If Not IsPostBack Then
08. 
09.            SetGridProp(RadGrid1, True)
10.        Else
11. 
12.        End If
13. 
14. 
15.    End Sub
16. 
17.    Private Sub SetGridProp(ByRef grd, ByVal auto)
18.        dt = dd.GenTableData2
19.        grd.AllowFilteringByColumn = True
20.        grd.FilterType = GridFilterType.CheckList
21.        grd.MasterTableView.PagerStyle.AlwaysVisible = True
22.        grd.AllowSorting = True
23. 
24.        ''''''''''''''''''
25.        'grd.MasterTableView.CheckListWebServicePath = "dt"
26. 
27.        If auto Then
28.            grd.MasterTableView.AutoGenerateColumns = False
29. 
30.            grd.MasterTableView.DataKeyNames = {dt.Columns(0).ColumnName}
31.            grd.MasterTableView.ClientDataKeyNames = {dt.Columns(0).ColumnName}
32. 
33.            Dim GridBoundCol As GridBoundColumn
34.            For index = 0 To dt.Columns.Count - 1
35.                GridBoundCol = New GridBoundColumn
36.                GridBoundCol.FilterDelay = 200
37.                GridBoundCol.FilterCheckListWebServiceMethod = dt.Columns(index).ColumnName
38.                GridBoundCol.DataField = dt.Columns(index).ColumnName
39.                GridBoundCol.HeaderText = dt.Columns(index).ColumnName
40.                grd.MasterTableView.Columns.Add(GridBoundCol)
41. 
42.            Next
43. 
44. 
45.            grd.DataSource = dt
46. 
47.            ''''''''''''''''''''
48.            'grd.ClientSettings.DataBinding.SelectMethod = ""
49.            'grd.ClientSettings.DataBinding.Location = ""
50.            grd.ClientSettings.DataBinding.SortParameterType = GridClientDataBindingParameterType.Linq
51.            grd.ClientSettings.DataBinding.FilterParameterType = GridClientDataBindingParameterType.Linq
52.        End If
53.    End Sub
54.   
55. 
56.    Private Sub RadGrid1_NeedDataSource(sender As Object, e As GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
57.        dt = dd.GenTableData2
58.        RadGrid1.DataSource = dt
59.    End Sub
60. 
61.     
62.    
63.End Class

Currently when I try to filter, the grid’s data doesn’t changed.

Another problem that I have is that sometimes when I delete the whole text from the filter textbox, all cells’ values are replaced with “System.Data.DataRowView”

P.S.  I've included a video that shows the problems I have.
http://youtu.be/0-FSvR5t-wQ

 Thanks,
Daniel
Eyup
Telerik team
 answered on 04 Nov 2014
4 answers
374 views
Hi,

I am developing a DNN module using telerik ajax controls. I am trying to open a radwindow in a radgrid editform template;

Settings: dotnetnuke 7 + christoc module, telerik ajax ui conrols: 2014 Q2 release 2. I have registered a usercontrol Patientupdate.ascx in DNN. Inside it I have several controls i.e. a radgrid (ResultaatGrid)  and a radwindow, also as a user control (but not registered in DNN)  named COVUserControl. The radwindow is called inside a radgrid in formedit mode when a button is click.

a snippet of the code for the radwindow(inside the patientupdate.ascx)

In the radwindow I have put the usercontrol (COVUserControl) and inside the user control I have defined a radgrid.

<telerik:RadWindow ID="COVWindow" Title="Editing record" Width="270"
        Height="540" VisibleOnPageLoad="false" Behaviors="Resize, Minimize, Close, Pin, Maximize, Move"
        Left="610" EnableShadow="true" runat="server" OnClientClose="refreshGrid" Modal="true">
    <ContentTemplate>
         <asp:Panel ID="Panel1" runat="server">
                <COVUC:COVUserControl runat="server" ID="COVUCID"/>
        </asp:Panel>
    </ContentTemplate>
</telerik:RadWindow>

In the edit template I have a button named <COV check> (in the patientupdate.ascx)  and in the code behind of the patientupdate.ascx.cs

in the ResultaatGrid_Itemcommand  I have the following code:

         protected void ResultaatGrid_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == "COV")
            {
                GridEditableItem editedItem = e.Item as GridEditableItem;

                string pCperID = editedItem.GetDataKeyValue("cpersoon_id").ToString();
                COVWindow.Width = 500;
                COVWindow.Height = 250;
                COVUserControl COVUC1 = COVWindow.ContentContainer.FindControl("COVUCID") as COVUserControl;
                COVUC1.cPersoonID = pCperID;
                RadGrid COVGrid = COVUC1.FindControl("COVGrid") as RadGrid;
                string script = "function f(){$find(\"" + COVWindow.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "key", script, true);
                COVGrid.Rebind();
            }

        }


The problem is that the radwindow does not pop-up.  (I have check the pop-up in host -> extension-> and check allow pop-ups for the module).

When debugging (attach) I see Covgrid.rebind is fired because it fires the radgrid need datasource of the grid inside the COVUserControl.

I think that the following code lines does not fire:

    string script = "function f(){$find(\"" + COVWindow.ClientID + "\").show();Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
    ScriptManager.RegisterStartupScript(this, this.GetType(), "key", script, true);

Simalar code works (except the radscriptmanager which I cannot used it in DNN because DNN used it's own scriptmanager) , the radwindow pop-up, when NOT a dotnetnuke module. (if the code in patientupdate.ascx is moved to a plain aspx).

Please help, I need to solve this issue :-(

Thanks in advance,

Regards,

Henk

Henk
Top achievements
Rank 1
 answered on 04 Nov 2014
5 answers
145 views
Hello,
We have a Grid Filter Menu on a GridBoundColumn with a data type of DateTime coming from the DataSet. The Filter Menu tries to use a DateFormat when filtering and we get this error if we don't enter the correct date format.

 "Line: 6
Error: Sys.WebForms.PageRequestManagerServerErrorException: String was not recognized as a valid DateTime."

We also have some GridBoundColumns that have a data type of boolean. When we use their filter menu both a checkbox and a textbox is displayed. The textbox is useless.

We realize that one fix is to just change the columns to GridDateTime and GridCheckBox but we are hesitating with this fix because it is a big change to our application and we are worried that these other column types will have more overhead than gridboundcolumn and will end up slowing performace. Please advise us.
Thanks.
Pavlina
Telerik team
 answered on 04 Nov 2014
1 answer
336 views
Since we updated our RadControls to the latest version, we noticed the clientside set_autoPostBack functionality has changed.

 
If you want a confirmation from the user before the button is posted, we set the autopostback to false. Once all is confirmed we put it back on true.

Like:
<head runat="server">
    <script>
        function ConfirmButton(button, args) {
            button.set_autoPostBack(false);
             
            if( confirm('Are you sure?'))
                button.set_autoPostBack(true);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:radscriptmanager runat="server" />
        <asp:Literal runat="server" ID="ltStatus" /><br/>
        <telerik:radbutton id="btnCredit" runat="server" text="DoPostback?" onclientclicked="ConfirmButton" onclick="btnCredit_OnClick" />
    </form>
</body>

When you confirm, the button doesn't get postbacked.
Introducing a var with the confirmvalue will work, but why is this ?

<script>
    function ConfirmButton(button, args) {
        var setPostback = false;
        if (confirm('Are you sure?'))
            setPostback = true;
 
        button.set_autoPostBack(setPostback);
    }
</script>


Our previous Telerik Version was 2013.1.504.40

Thanks in advance

Danail Vasilev
Telerik team
 answered on 04 Nov 2014
3 answers
421 views
When creating a stacked bar chart with the labels on each colored section, the label should not be displayed if the value is zero.

I have attached an example of how Excel would create this chart and the result that I get using RadHtmlChart. Is there at least a workaround that I could do to clear out the zero labels?
Danail Vasilev
Telerik team
 answered on 04 Nov 2014
1 answer
179 views
Hello,

Is it possible to hide markers on this type of chart and to highlight them only on mouseover ?
I saw on the forum that it is possible with kendo but I would like to know with ASP.NET ajax charts

Thanks a lot.
Danail Vasilev
Telerik team
 answered on 04 Nov 2014
7 answers
219 views
Hi,

    We have a issue after  Upgrading the Telerik dll Version(2012.2.724.40) (Web.UI,Web.Design,Web.UI.Skins) to Version(2013.3.1114.40)
in new version(2013.3.1114.40) Rad-grid header is not shown in IE.This working fine in FireFox and Chrome.

Sample html:



        <telerik:RadGrid    ID="radMailboxGrid" GridLines="Horizontal" OnItemDataBound="OnRadGridOnItemDataBound"
            runat="server" AutoGenerateColumns="false" Height="250px" Width="100%" EnableEmbeddedSkins="false"
            AllowSorting="True"  OnPreRender="OnRadGridOnPrerender" >
           
            <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="false">
                <Scrolling AllowScroll="True" UseStaticHeaders="true" SaveScrollPosition="true" />
                <Selecting AllowRowSelect="true" />
                <ClientEvents OnRowSelected="RowDblClick" />
                
            </ClientSettings>
            <HeaderStyle BackColor="#CCCCCC" />
            <MasterTableView AllowSorting="true" DataKeyNames="EmailID" TableLayout="Fixed" Width="100%"
                ItemStyle-CssClass="Hand">
                    <NoRecordsTemplate>
      <div>
        "No emails to display."</div>
    </NoRecordsTemplate>
                <Columns>
            
                    <telerik:GridTemplateColumn HeaderStyle-Width="2%" ItemStyle-Width="2%">
                        <ItemTemplate>
                            
                                <img runat="server" id="imgmail" style='border: 0px;padding-left:2px; ' />
                           
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn ItemStyle-Width="2%" HeaderStyle-Width="2%" SortExpression="EmailPriorityID"
                        HeaderImageUrl="/Images/candidate/layout/emailPriority.gif">
                        <ItemTemplate>
                            <img runat="server" id="imgPriority" style='border: 0px;' />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn ItemStyle-Width="2%" HeaderStyle-Width="2%" SortExpression="HasAttachments"
                        HeaderImageUrl="/images/candidate/layout/Attachment.png">
                        <ItemTemplate>
                            <img runat="server" id="imgAttachment" style='border: 0px;' />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn ItemStyle-Width="40%" HeaderStyle-Width="40%" SortExpression="EmailSubject"
                        HeaderText="Subject" DataField="EmailSubject">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn ItemStyle-Width="40%" HeaderStyle-Width="40%" SortExpression="EmailFrom"
                        HeaderText="From" DataField="EmailFrom">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn ItemStyle-Width="14%" HeaderStyle-Width="14%" SortExpression="ModifiedDisplayDate"
                        HeaderText="Received" DataField="ModifiedDisplayDate">
                    </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn Display="false" DataField="EmailID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn Display="false" DataField="IsCoach">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>

Please give me a solution..
Thanks
Venelin
Telerik team
 answered on 04 Nov 2014
1 answer
276 views
Hi guys,

we are using radgrid to display data from database.
Now problem is that, if i click on Paging forward arrow or backward arrow my page is not working. Only if i click on number for the next page then only i am getting the result. can any one help me on this ..
 
Below is the code which use for grid view. Please help it's very urgent.

 <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
     <telerik:RadAjaxLoadingPanel ID="RadLoadingPanel1" runat="server" />
         <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
               <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="radProductsGrid">
                    <UpdatedControls>
                    <telerik:AjaxUpdatedControl  LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                    </telerik:AjaxSetting>
               </AjaxSettings>
         </telerik:RadAjaxManager>
     <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
     <asp:Image ID="Image1" runat="server" ImageUrl="image/loader_gif.gif"></asp:Image>
   </telerik:RadAjaxLoadingPanel>
    <telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="Buttons" >
    </telerik:RadFormDecorator> 


<telerik:RadGrid ID="RadGrid1" EnableViewState="True" runat="server" AllowPaging="true" ShowFooter="true" AllowSorting="True" AllowFilteringByColumn="true" GridLines="None" AutoGenerateColumns="false" Skin="Sunset" OnItemCommand ="RadGrid1_ItemCommand" PageSize ="10">
        <%--<HeaderStyle BackColor="DarkBlue" />--%>
         <ItemStyle Wrap="false"></ItemStyle>
          <GroupingSettings CaseSensitive="false" />
            <ClientSettings>
                <Scrolling AllowScroll="True" UseStaticHeaders="true" />
            </ClientSettings>
              <%--<AlternatingItemStyle BackColor="LightBlue" />--%>
           <MasterTableView AllowMultiColumnSorting="true" TableLayout="Fixed" AutoGenerateColumns="false" CommandItemDisplay="Top">
                 <CommandItemTemplate>
                <div style="padding: 5px 5px; background-color:#FFFFFF; border:0px;">
                     <asp:Label CssClass="lblrepname" ID="Label1" runat="server" Text="Primary Insurance Aging"></asp:Label>
                <%--<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="image/down.png"
               OnClick="ImageButton1_Click" AlternateText="Html" /> Download--%>
                   <%-- <asp:linkbutton id="btnEditSelected" runat="server" CommandName="EditSelected" Visible='<%# RadGrid1.EditIndexes.Count == 0 %>'><img style="border:0px;vertical-align:middle; text-align:right;" alt="" src="image/down.png" /> Edit selected</asp:LinkButton> --%>

                </div>
                    </CommandItemTemplate>


               <Columns>
                <telerik:GridBoundColumn DataField="Practice_Short_Name" HeaderStyle-CssClass="Headalign" AllowFiltering="true" AutoPostBackOnFilter="true" FilterControlAltText="Practice_Short_Name" Visible ="false" ShowFilterIcon ="false" CurrentFilterFunction="EqualTo"
                    HeaderText="Practice Short Name" UniqueName="PSN">
                </telerik:GridBoundColumn>

               <telerik:GridBoundColumn DataField="Carrier_Name" HeaderStyle-CssClass="Headalign" FilterControlAltText="Carrier_Name" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="false" AllowFiltering="true" AllowSorting="true"
                    HeaderText="Carrier Name" UniqueName="AS">
                </telerik:GridBoundColumn>

               <telerik:GridTemplateColumn  AllowSorting="true" HeaderStyle-CssClass="Headalign" SortExpression="No_Of_Vouchers" FilterControlWidth="100px" ShowFilterIcon="False" CurrentFilterFunction="EqualTo" AutoPostBackOnFilter="true" DataField="No_Of_Vouchers" HeaderText = "Number of Claims"  > 
                        <ItemStyle HorizontalAlign ="Center" />
                        <ItemTemplate>
                            <asp:Label ID="lblclaimno" runat="server"   Text='<%#Convert.ToInt32(Eval("No_Of_Vouchers")) %>' ></asp:Label>
                        </ItemTemplate>
                       
                    </telerik:GridTemplateColumn>
                      <telerik:GridTemplateColumn DataField="Acer_Actual_Balance" HeaderStyle-CssClass="Headalign" FilterControlAltText="Acer_Actual_Balance"
                    HeaderText="Actual Balance" UniqueName="lblaceractual"  ShowFilterIcon ="false" AllowSorting ="true" SortExpression ="Acer_Actual_Balance">
                             <ItemStyle HorizontalAlign ="Right" />
                              <ItemTemplate>
                             <asp:Label ID="lblaceractual" runat="server"    Text='<%#String.Format("{0:C0}",Convert.ToInt32(Eval("Acer_Actual_Balance"))) %>' ></asp:Label>
                           </ItemTemplate>
                </telerik:GridTemplateColumn>
                  
                    <telerik:GridTemplateColumn  AllowSorting="true" HeaderStyle-CssClass="Headalign" SortExpression="Zero_To_Thirty_Days" AutoPostBackOnFilter="true" DataField="Zero_To_Thirty_Days" HeaderText = "0 to 30 Days" ShowFilterIcon ="false" AllowFiltering="false"> 
                        <ItemStyle HorizontalAlign ="Right" />
                        <ItemTemplate>
                           <asp:LinkButton ID="Lnkzero" runat="server"  ForeColor ="Blue"  CommandArgument='<%#Eval("Practice_Short_Name") %>' CommandName="ZeoDays" Text ='<%#String.Format("{0:C0}",Convert.ToInt32(Eval("Zero_To_Thirty_Days")))%>'  ></asp:LinkButton>
                        </ItemTemplate>
                       
                    </telerik:GridTemplateColumn>
                      
                    <telerik:GridTemplateColumn  HeaderText="31 to 60 Days" HeaderStyle-CssClass="Headalign" allowfiltering="false" AllowSorting="true" SortExpression="Thirtyone_To_Sixty_Days" AutoPostBackOnFilter="true" DataField="Thirtyone_To_Sixty_Days" ShowFilterIcon="false" >
                        <ItemStyle HorizontalAlign ="Right" />
                        <ItemTemplate>
                                <asp:LinkButton ID="Lnkthirtydays" runat="server"  ForeColor ="Blue"  CommandArgument='<%#Eval("Practice_Short_Name") %>' CommandName="ThirtyDays" Text ='<%#String.Format("{0:C0}",Convert.ToInt32(Eval("Thirtyone_To_Sixty_Days")))%>'  ></asp:LinkButton>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                     <telerik:GridTemplateColumn  HeaderText="61 to 90 Days" HeaderStyle-CssClass="Headalign"  AllowSorting="true" AllowFiltering="false" SortExpression="Sixtyone_To_Ninety_Days" AutoPostBackOnFilter="true" DataField="Sixtyone_To_Ninety_Days" ShowFilterIcon ="false" >
                            <ItemStyle HorizontalAlign ="Right" />
                        <ItemTemplate>
                                 <asp:LinkButton ID="Lnksixty" runat="server"  ForeColor ="Blue"  CommandArgument='<%#Eval("Practice_Short_Name") %>' CommandName="sixtyDays" Text ='<%#String.Format("{0:C0}",Convert.ToInt32(Eval("Sixtyone_To_Ninety_Days")))%>'  ></asp:LinkButton>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                     <telerik:GridTemplateColumn  DataField="Ninetyone_Days_Plus" HeaderStyle-CssClass="Headalign" FilterControlAltText="Ninetyone_Days_Plus" ShowFilterIcon ="false" AllowFiltering ="false" AllowSorting ="true" SortExpression ="Ninetyone_Days_Plus"
                    HeaderText="90+Days" UniqueName="nintyplus"  > 
                      <ItemStyle HorizontalAlign ="Right" />
                           <ItemTemplate>
                                <asp:LinkButton ID="Lnkninty" runat="server"  ForeColor ="Blue"  CommandArgument='<%#Eval("Practice_Short_Name") %>' CommandName="NinetyPlus" Text ='<%#String.Format("{0:C0}",Convert.ToInt32(Eval("Ninetyone_Days_Plus")))%>' ></asp:LinkButton>
                           </ItemTemplate>
                       </telerik:GridTemplateColumn>
            
                </Columns>
               
            </MasterTableView>

        </telerik:RadGrid>





Maria Ilieva
Telerik team
 answered on 04 Nov 2014
33 answers
1.3K+ views
Based on localization documentation, to use a global resource file for a specific language, you must set the Culture property on the grid itself in each page.  We have over 80% of our pages and controls that contain RadGrids.  This is not feasible as the application's Culture is dynamic - selected by the user at login.

Is there a way to set the Culture for ALL grids in ONE place based on user-input? 

Thanks.
Michael
Top achievements
Rank 2
 answered on 04 Nov 2014
1 answer
120 views
Hello,

I have used RadListBox and RadEditor for Drag and drop functionality.

Scenario 1: I dragged "SomeText" from RadListBox and dropped in the RadEditor. When i press BACKSPACE, it only removes the "t" from the dropped Item "SomeText" and it becomes "SomeTex" in the RadEditor.

What I want is When its is dropped in the editor it should be treated as a complete object and if i press BACKSPACE, the whole item "SomeText" Should be removed from the RadEditor instead of just "t". How Can i do it.. .. ..

Scenario 2 : Is it possible to drag the item and drop it on the current Mouse position in the RadEditor, instead of Cursor position.

 
Ianko
Telerik team
 answered on 04 Nov 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?