Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
206 views
I have a client who wants to be able to select more than one type of option when filtering against a particular column in a radgrid.  Say they want to see all accounts that are either High or Low Risk Levels.  However, they also want regular radgrid filtering for the other columns in this grid such as accountant name.  

I created a listbox with a hidden radfilter to accommodate selecting multiple options for the risk level: Select say, "Low" and "High" at the same time.  However, if I want to also filter down to a specific accountant, the radfilter expression is no longer applied.

Is there a way to use both the radfilter, AND the radgrid's filter controls?  Thanks!  I am attaching my code.  Thank you for your help.

ASP.NET:
<script type="text/javascript">
        function onRequestStart(sender, args) {
            //alert(args.get_eventTarget().toString())
            if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0) {
                args.set_enableAjax(false);
            }
            else {
                args.set_enableAjax(true);
            }
        }
    </script>
 
    <br />
    <br />
    <asp:Table runat="server" ID="table1" Width="873px">
            <asp:TableHeaderRow>
                <asp:TableHeaderCell ColumnSpan="2">Accounts By Risk Level</asp:TableHeaderCell>
            </asp:TableHeaderRow>
            <asp:TableRow>
                <asp:TableCell ColumnSpan="2">
                     To narrow down the report by risk level, select an option in the box below.  To see more than one risk level, press and hold the "Ctrl" key on your keyboard while selecting the levels you wish to view.  To see all levels, click the "View All Risk Levels" button.
                </asp:TableCell>
            </asp:TableRow>
            <asp:TableRow>
                <asp:TableCell Width="20%">
                     <telerik:RadListBox ID="RadListBox1" runat="server" Skin="WebBlue" Width="100px"
                        SelectionMode="Multiple" AutoPostBack="true">
                     <Items>
                         <telerik:RadListBoxItem runat="server" Text="Low" Value="Low" />
                         <telerik:RadListBoxItem runat="server" Text="Medium" Value="Medium" />
                         <telerik:RadListBoxItem runat="server" Text="High" Value="High" />
                         <telerik:RadListBoxItem runat="server" Text="Reimbursement" Value="Reimbursement" />
                         <telerik:RadListBoxItem runat="server" Text="Unassigned" Value="Unassigned" />
                     </Items>
                     </telerik:RadListBox>
                     <br />
                     <telerik:RadButton ID="RadButton1" runat="server" Text="View All Risk Levels" Skin="WebBlue" >
                    </telerik:RadButton>
                                         
                </asp:TableCell>
            </asp:TableRow>
            <asp:TableRow>
                <asp:TableCell ColumnSpan="2">
                <br /><br />
                    <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True"
                                   AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
                                   GridLines="None" Skin="WebBlue" width="100%"
                                    CellSpacing="0" PageSize="10">
 
                        <ExportSettings Excel-Format="ExcelML" ExportOnlyData="True" FileName="AccountsByRiskLevel"></ExportSettings>
                        <MasterTableView CommandItemDisplay="Top">
                        <CommandItemSettings ExportToPdfText="Export to PDF" ShowAddNewRecordButton="False" ShowRefreshButton="False" ShowExportToExcelButton="True"></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="name"
                                    FilterControlAltText="Filter Muni_Name column" HeaderText="Name"
                                    UniqueName="Name">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Account" FilterControlAltText="Filter Account column"
                                    HeaderText="CID" UniqueName="Account">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Accountant"
                                    FilterControlAltText="Filter Accountant column"
                                    HeaderText="FEAD Accountant" UniqueName="Accountant">
                                </telerik:GridBoundColumn>
                               <telerik:GridDateTimeColumn DataField="end_date"
                                    FilterControlAltText="Filter end_date column" HeaderText="End Date"
                                    UniqueName="end_date" DataFormatString="{0:d}" PickerType="DatePicker" FilterControlWidth="125px">
                                    <HeaderStyle Width="160px" />
                                    <ItemStyle Width="160px" />
                                </telerik:GridDateTimeColumn>                              
                                <telerik:GridBoundColumn DataField="risk_level"
                                    FilterControlAltText="Filter risk column" HeaderText="Risk Level"
                                    UniqueName="risk">
                                </telerik:GridBoundColumn>
                            </Columns>
 
                        <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                        </EditFormSettings>
                        </MasterTableView>
 
                        <FilterMenu EnableImageSprites="False"></FilterMenu>
 
                        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_WebBlue"></HeaderContextMenu>
                    </telerik:RadGrid>
 
                    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="WebBlue" width="873px">
                    </telerik:RadAjaxLoadingPanel>
                </asp:TableCell>
            </asp:TableRow>
        </asp:Table>
 
        <br />
         
    <asp:Panel ID="Panel1" runat="server" Visible = "false">
            <telerik:RadFilter ID="RadFilter1" runat="server" FilterContainerID="RadGrid1" Enabled="false" ShowApplyButton="false">
            </telerik:RadFilter>
    </asp:Panel>
    <br />
    <telerik:RadAjaxManager runat="server">
    <ClientEvents OnRequestStart="onRequestStart" />
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadListBox1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadListBox1" />
                    <telerik:AjaxUpdatedControl ControlID="RadListFilter1" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadButton1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadButton1" />
                    <telerik:AjaxUpdatedControl ControlID="RadListBox1" />
                    <telerik:AjaxUpdatedControl ControlID="RadListFilter1" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

VB.NET:
Private Sub RadGrid1_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
        connSql.ConnectionString = sqlConn.ToString()
 
        Dim poSqlCom As New SqlCommand("dbo.AccountRiskLevel", connSql)
        poSqlCom.CommandType = CommandType.StoredProcedure
 
        Dim adapter As New SqlDataAdapter(poSqlCom)
 
        Try
            adapter.Fill(dtRisk)
        Catch ex As Exception
            'lblResult.Text = ex.Message
            If connSql.State = ConnectionState.Open Then
                connSql.Close()
            End If
        End Try
 
        RadGrid1.DataSource = dtRisk
 
    End Sub
 
    Protected Sub RadGrid1_ItemDataBound(sender As Object, e As GridItemEventArgs) Handles RadGrid1.ItemDataBound
        If TypeOf e.Item Is GridFilteringItem Then
            Dim filteringItem As GridFilteringItem = TryCast(e.Item, GridFilteringItem)
            filteringItem.Cells(8).Controls(0).Visible = False
            filteringItem.Cells(8).Controls(1).Visible = False
        End If
    End Sub
 
 
Private Sub RadListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadListBox1.SelectedIndexChanged
        RadFilter1.RootGroup.GroupOperation = RadFilterGroupOperation.Or
 
        Dim count As Integer = 0
        RadFilter1.RootGroup.Expressions.Clear()
 
        For Each item In RadListBox1.SelectedItems
            If count = 0 Then
                Dim expr1 As New RadFilterEqualToFilterExpression(Of String)("risk_level")
                expr1.Value = item.Value
                RadFilter1.RootGroup.AddExpression(expr1)
            ElseIf count = 1 Then
                Dim expr2 As New RadFilterEqualToFilterExpression(Of String)("risk_level")
                expr2.Value = item.Value
                RadFilter1.RootGroup.AddExpression(expr2)
            ElseIf count = 2 Then
                Dim expr3 As New RadFilterEqualToFilterExpression(Of String)("risk_level")
                expr3.Value = item.Value
                RadFilter1.RootGroup.AddExpression(expr3)
            ElseIf count = 3 Then
                Dim expr4 As New RadFilterEqualToFilterExpression(Of String)("risk_level")
                expr4.Value = item.Value
                RadFilter1.RootGroup.AddExpression(expr4)
            ElseIf count = 4 Then
                Dim expr5 As New RadFilterEqualToFilterExpression(Of String)("risk_level")
                expr5.Value = item.Value
                RadFilter1.RootGroup.AddExpression(expr5)
            End If
 
            count = count + 1
        Next
 
        RadFilter1.FireApplyCommand()
 
    End Sub
 
    Private Sub RadButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadButton1.Click
        RadFilter1.RootGroup.Expressions.Clear()
        RadFilter1.FireApplyCommand()
        RadListBox1.ClearSelection()
    End Sub
#End Region
Marin
Telerik team
 answered on 02 Nov 2011
1 answer
133 views
I'm working with the RadFileExplorer, and with the encapsulated upload control within the RadFileExplorer;

If a Black template is applied to the RadFileExplorer, the "remove" text for the remove button is washed out on the upload control - if a default template is utilized for the upload feature, the "remove" text for the remove button is displayed;  

I'm writing to ask if the "remove" text can be applied with C# programmatically, etc.

Thanks in advance for any insight;  Best regards - Rob
Bozhidar
Telerik team
 answered on 02 Nov 2011
1 answer
71 views
Is it possible to bind the results from a Linq to SharePoint query to the SPRadGridWebPart? Can you please provide an example, if this is possible?

Thanks,
Larkin
Marin
Telerik team
 answered on 02 Nov 2011
1 answer
94 views
Hello,

I'm using a simple horizontal telerik menu in a user control, everything loaded alright and the menu looks great.
However, after a few clicks on the menu, going back and forth from Default.aspx to News.aspx, the menu just freezes.
I no longer see the hover styles and the links won't click.

Any advise on this one?

PS: I'm using C# in VS2010
Kate
Telerik team
 answered on 02 Nov 2011
1 answer
117 views
Hi,
 I am working with Telerik Radgrid. In this radgrid I am using dropdownlist in edit template in a way that when user clicks on add button on the grid, The whole grid goes into the editmode. By doing so when user clicks on the first dropdown list it postbacks and reload the whole page which populates the second dropdown list with data. 


I want to ajaxify the radgrid on the page, so the whole page does not get refresh or postback. I have used both ajax manager and rad ajax panel to perform this job. But unfortunately the whole page gets autopostback. In my code behind in item created event i have set the dropdown as autopostback to true. I have read through so many blogs and demos on telerik website. But so far I haven't found any solution regarding my issue.

I am providing you the design source. Please tell me how to handle this ajax request on client side and server side. Provide me any small example which is following my scenario or most efficient way to handle this request.

Thanks


 <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
                                        </telerik:RadScriptManager>


                                           <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" 
                                     DefaultLoadingPanelID="RadAjaxLoadingPanel1>
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1t">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

<telerik:RadGrid ID="RadGrid1" ShowStatusBar="true" runat="server" AutoGenerateColumns="False" Skin="Outlook" AlternatingItemStyle="VerticalAlign">
                                      
         
                                         <MasterTableView  CommandItemDisplay="Top" TableLayout="Fixed" >
          <CommandItemTemplate>
                                        <asp:LinkButton ID="btnEdit" runat="server" Text="Edit" OnClick="btnEdit_Click">
                                        </asp:LinkButton>
                                        </CommandItemTemplate>
 <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
                         <Columns>
              telerik:GridTemplateColumn DataField="Project" HeaderStyle-ForeColor="White" HeaderText="Company"  UniqueName="Company">
                    <ItemTemplate>
<asp:Label id="lblCompany" runat="server"></asp:Label>
   </ItemTemplate>
                    <EditItemTemplate>
                    
<asp:DropDownList id="ddCompany" runat="server" Width="80px"></asp:DropDownList>
                    <asp:RequiredFieldValidator id="vldddProjectRequired" runat="server" ErrorMessage="Please select a Company" 
ControlToValidate="ddCompany">!</asp:RequiredFieldValidator>
</EditItemTemplate>
                    </telerik:GridTemplateColumn> 


                    <telerik:GridTemplateColumn DataField="Employees" HeaderStyle-ForeColor="White" HeaderText="Employees" UniqueName="Employee" >
                    <ItemTemplate>
   <asp:Label id="lblEmployee" runat="server"></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList id="ddEmployee" runat="server" Width="170px" ></asp:DropDownList>
</EditItemTemplate>
                    </telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>



Sebastian
Telerik team
 answered on 02 Nov 2011
1 answer
98 views
HI guys

I have a website with two types of master page, but both containing the same panelBar menu.
For maintainability, I want to have only a single place to update the menu so I thought I should
put it into ascx UserControl, and followed MS guidelines for the embedding

It actually works fine if I turn off debug in Internet Explorer (I am using Visual Studio 2010 btw), but when debug is on I get this error

SCRIPT5007: Unable to set value of the property 'control': object is null or undefined
Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl03_TSM&compress=1&_TSM_CombinedScripts_
=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%
3d31bf3856ad364e35%3aen-US%3a1f68db6e-ab92-4c56-8744-13e09bf43565%3aea597d4b%3ab25378d2%
3bTelerik.Web.UI%2c+Version%3d2010.3.1109.20%2c+Culture%3dneutral%2c+PublicKeyToken%
3d121fae78165ba3d4%3aen-US%3a0b207b76-976c-4925-ba92-57c3001b0b77%3a16e4e7cd%3af7645509%
3a24ee1bba%3a1e771326%3a4cacbc31, line 6 character 74101

The ascx file is like this:

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="menuBar.ascx.vb" Inherits="UserControls_menuBar" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<telerik:RadPanelBar ID="RadPanelBar1" Runat="server" Skin="myBlack" Width="175px"
                        EnableEmbeddedSkins="False" PersistStateInCookie="True">
etc etc
</telerik:RadPanelBar>

I would like to avoid the error in case it causes problems to visitors.  Can you shed any light on this?
The error is within the telerik dll it seems.

Thanks for any help!

Clive


Nikolay Tsenkov
Telerik team
 answered on 02 Nov 2011
1 answer
77 views
we are getting the following error only on Apple machines (ipad included) across all browser.  the funny thing is that its only when the page is loaded.  it's loaded with an ajax call and all we ever see is the loading panel.  on the mac computer we were able to get the error

RadUpload Ajax callback error. Source url returned invalid content: 

any suggestions on what we can try.  the page works fine on PC across all browsers.  there is an upload on the page but its not uploading anything at the time of the error.  its just loading the page.  the page is on a RadTab if that makes a difference.

Genady Sergeev
Telerik team
 answered on 02 Nov 2011
1 answer
76 views
Hi ,

  I am using radDatetImepIcker as a seperate control .(Not inline with grid or anything else). I need to set date/time in picker by default based on my server time zone like ‘DD.MM.YYYY HH24:MI:SS TZR’.


Please advice as soon as earlier.

THanks,
Priya
Vasil
Telerik team
 answered on 02 Nov 2011
3 answers
71 views
I need to customize the groupings in a grid.
In my case, I group by a column 'GridDropDownColumn' which has as public properties 'DataField = "ID"' and 'ListTextField = "description"', so in group shows a number instead of the description provided in the 'DropDown'.
Radoslav
Telerik team
 answered on 02 Nov 2011
2 answers
200 views
Hello.
i am working on a project, i used telerik control to upload the files. but now what is the problem it doesnot show progross area while uploading.

here are the steps i done
  1. Added all entries in web.config (modules, http handlers for telerik )
  2. set <httpRuntime maxRequestLength="102400" executionTimeout="3600"/> to allow files more than 50 mb
  3. uploading files is succcessfull, but it is not showing the progress area, as i tried to transfer 35 mb file. in localhost :(
  4. i'm having iis 7.5

i'm attaching my files to you . kindly check it and tell me whats the prob with these codes. i followed the same code in your demo examples

please do support soon, as i am having to relase files for production :(
Dimitar Terziev
Telerik team
 answered on 02 Nov 2011
Narrow your results
Selected tags
Tags
+124 more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
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
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?