Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
164 views
I have a SQL database that users should be able to query.  However, the database has some fields that are similar and when they choose to build a filter on one of those columns, I want to also include the same function for the other column(s) as well.  I am not trying to bind the filter directly to a data source, but will programmatically bind it in the code.

For example, if a user selects to filter on Manufacturer starts with 'somecompany', I want to build the SQL query to look like:
ManfName like 'somecompany%' or AltManf like 'somecompany%' or GenericManf like 'somecompany%'

I have been able to create the code to loop the generated expressions, but I am really hoping that there is a much easier way to accomplish my objective.  As it is, I have to use a recursive subroutine to process each of the groups, and manually build the SQL code.  For example, I can use

Dim rfProvider As New RadFilterSqlQueryProvider
rfProvider.ProcessGroup(e.ExpressionRoot)

To build the SQL string, but then there is a LOT of coding that would be required to parse through the string and inject the additional SQL code.

What I want to be able to do is use the recursive call to get the current SQL code, then use a string replacement function to add the check for the additional fields to the query.  The snippet below would be an example of what I am trying to accomplish, but don't know how.

dim queryString as string
 
Protected Sub RadFilter1_ApplyExpressions(sender As Object, e As Telerik.Web.UI.RadFilterApplyExpressionsEventArgs) Handles RadFilter1.ApplyExpressions
    queryString = String.Empty
    Dim objExpression As RadFilterGroupExpression = e.ExpressionRoot
    Dim objCollection As RadFilterExpressionsCollection = objExpression.Expressions
    processGroup(objCollection)
End Sub
 
Private Sub processGroup(ByVal objCollection As RadFilterExpressionsCollection)
  For Each objExp As RadFilterExpression In objCollection
    Dim objFunction As RadFilterFunction = objExp.FilterFunction
    Dim rfProvider As New RadFilterSqlQueryProvider
  ' I don't know how to produce the functionality of the next statement!
    Dim strFilter as new string = rfProvider.ProcessFilter(RadFilterExpression)  ' This would return "Manufacturer like 'somecompany%'"
     
    if strFilter.StartsWith("Manufacturer") then
      queryString &= " (" & strFilter.Replace("Manufacturer","ManfName") & _
        " or " & strFilter.Replace("Manufacturer", "AltManf") & _
        " or " & strFilter.Replace("Manufacturer", "GenericManf") & ") "
    end if
    ...
  Next
End Sub

Can you please provide any suggestions?  Thank you!!!

Andrey
Telerik team
 answered on 15 Jun 2012
5 answers
964 views

In button click to Dynamically created checkbox and dropdown list how to get checkbox.checked=true and dropdown values to find

This is my code
             chk_Dynamic = new CheckBox();
            Panel1.Controls.Add(chk_Dynamic);
            dropdown = new RadComboBox();
            dropdown.ID = "dropdown";
            Panel1.Controls.Add(dropdown);
            dropdown.Height = Unit.Pixel(200);
            dropdown.Width = Unit.Pixel(110);
            dropdown.BackColor = System.Drawing.Color.LightGray;
            dropdown.Items.Insert(0, new RadComboBoxItem("--Select--", "-1"));
            dropdown.Items.Insert(1, new RadComboBoxItem("Today", "10000000000001"));
            dropdown.Items.Insert(2, new RadComboBoxItem("Yesterday", "10000000000002"));
            dropdown.Items.Insert(3, new RadComboBoxItem("This Week", "10000000000003"));
            dropdown.Items.Insert(4, new RadComboBoxItem("Last Week", "10000000000004"));
            dropdown.Items.Insert(5, new RadComboBoxItem("This Month", "10000000000005"));
            dropdown.Items.Insert(6, new RadComboBoxItem("Last Month", "10000000000006"));
            dropdown.Items.Insert(7, new RadComboBoxItem("This Quarter", "10000000000007"));
            dropdown.Items.Insert(8, new RadComboBoxItem("Last Quarter", "10000000000008"));
            dropdown.Items.Insert(9, new RadComboBoxItem("This Year", "10000000000009"));
            dropdown.Items.Insert(10, new RadComboBoxItem("Last Year", "10000000000010"));

Advance
Thanks
Tamim
Eyup
Telerik team
 answered on 15 Jun 2012
1 answer
148 views
I am having a problem with a chart I am trying to implement where it will not show any bars going up the bar graph.  A pie chart will display all of the data, but all other chart types fail.  I have confirmed the data is being entered into the dt and my code below shows you how I am doing this.  I have also included a screenshot of what the output on the graph is as well as a screenshot of the data after the loop completes.  Any help would be greatly appreciated.  

Protected Sub CreateChart()
        Dim dt As New DataTable
        Dim dc As DataColumn
        Dim dr As DataRow
        Dim ctr As Integer = 0
 
        Dim usableMonths As String = Me.Invoice.Custom45.ToString()
        Dim usableData As String = Me.Invoice.Custom46.ToString()
 
        Dim months() As String = usableMonths.Split(New [Char]() {","c})
        Dim data() As String = usableData.Split(New [Char]() {","c})
 
        dc = New DataColumn("XValues", Type.GetType("System.Int32"))
        dc.AutoIncrement = True
        dc.AutoIncrementSeed = 300
        dt.Columns.Add(dc)
 
        dc = New DataColumn("XDesc", Type.GetType("System.String"))
        dt.Columns.Add(dc)
 
        dc = New DataColumn("YValues", Type.GetType("System.Double"))
        dt.Columns.Add(dc)
 
        While ctr <= months.Length - 2
            dr = dt.NewRow
 
            If String.IsNullOrEmpty(months(ctr).ToString().Trim()) Then
                dr(1) = " "
            Else
                dr(1) = months(ctr)
            End If
 
            If String.IsNullOrEmpty(data(ctr).ToString().Trim()) Then
                dr(2) = 0
            Else
                dr(2) = Convert.ToDouble(data(ctr))
            End If
 
            dt.Rows.Add(dr)
 
            ctr += 1
        End While
 
        dt.AcceptChanges()
 
        Me.RadChart1.DataSource = dt
 
        Dim usage As New Telerik.Charting.ChartSeries("Usage", Telerik.Charting.ChartSeriesType.Bar)
        usage.DataXColumn = "XValues"
        usage.DataYColumn = "YValues"
        usage.Appearance.BarWidthPercent = 30
        usage.DefaultLabelValue = String.Empty
        usage.Visible = True
 
        Me.RadChart1.Series.Add(usage)
        Me.RadChart1.Width = Unit.Pixel(480)
        Me.RadChart1.Height = Unit.Pixel(200)
        Me.RadChart1.ChartTitle.Visible = False
        Me.RadChart1.Legend.Visible = False
        Me.RadChart1.PlotArea.XAxis.DataLabelsColumn = "XDesc"
        Me.RadChart1.PlotArea.XAxis.Appearance.TextAppearance.AutoTextWrap = Telerik.Charting.Styles.AutoTextWrap.True
        Me.RadChart1.PlotArea.XAxis.Appearance.MajorGridLines.Visible = False
        Me.RadChart1.PlotArea.XAxis.Appearance.MinorGridLines.Visible = False
        Me.RadChart1.PlotArea.YAxis.Appearance.MinorGridLines.Visible = False
        Me.RadChart1.PlotArea.Appearance.Dimensions.Margins.Top = Telerik.Charting.Styles.Unit.Pixel(20)
        Me.RadChart1.PlotArea.Appearance.Dimensions.Margins.Right = Telerik.Charting.Styles.Unit.Pixel(10)
        Me.RadChart1.PlotArea.Appearance.Dimensions.Margins.Bottom = Telerik.Charting.Styles.Unit.Pixel(40)
        Me.RadChart1.PlotArea.Appearance.Dimensions.Margins.Left = Telerik.Charting.Styles.Unit.Pixel(50)
        Me.RadChart1.Skin = "Classic"
 
        Me.RadChart1.DataBind()
    End Sub
Tony
Top achievements
Rank 1
 answered on 15 Jun 2012
2 answers
111 views
Hi Guys,

I've come across an issue with the file explorer in IE and was hoping you could let me know if this is a known issue and if there are any workarounds or not.

In IE the height of the explorer is forced down greatly. It looks as if the directory listing items you can't see are forcing the explorer size down.

Image can be seen below.

Explorer Image

Thanks.
Jibber4568
Top achievements
Rank 1
 answered on 15 Jun 2012
1 answer
195 views

I Have attached Screen shot. how could i Filed Name and Filed Type in RadFielter Dropdownlist

Advanced
Thanks
Tamim
Eyup
Telerik team
 answered on 15 Jun 2012
2 answers
245 views
Hello all,

I have a table with fields, PK | Student | Subject | Score

I would like that it displays

                 Subject 1         | Subject 2       | Subject 3        | Subject 4
Student 1  Blank Textbox | Blank Textbox | Blank Textbox| Blank Textbox
Student 2  Blank Textbox | Blank Textbox | Blank Textbox| Blank Textbox
Student 3 Blank Textbox | Blank Textbox | Blank Textbox| Blank Textbox
Student 4 Blank Textbox | Blank Textbox | Blank Textbox| Blank Textbox

Is there a sample code that would guide me with this?

Thank you
Milena
Telerik team
 answered on 15 Jun 2012
1 answer
88 views
I have used telerik control in my project. RadTabStrip inside RadTab inside panel.
I'm dynamically created CheckBox and RadComboBox and also get id.
i'm select CheckBox and RadComboBox value and save click to CheckBox and RadComboBox FindControl to get value is null

How Could i get findcontrol to CheckBox and RadComboBox values.

my coding is.
for (int j = 1; j <= i; j++)
            {
                if (j == i)
                {
                    chk_Dynamic = (CheckBox)Panel1.FindControl("ChkBox" + j.ToString());
                    Response.Write(" " + chk_Dynamic.ID + " is " + (chk_Dynamic.Checked == true ? "Checked" : "Un-Checked<br/>"));
                    if (chk_Dynamic.Checked == true)
                    {
                        if (dropdown.SelectedIndex == 0)
                            return;
                    }
                }
            }

Thanks
Tamim
Tamim
Top achievements
Rank 1
 answered on 15 Jun 2012
1 answer
122 views
i am using a line chart. there are some missing values in between the points. i want to connect those points. I haved tried to use emptyvalue property then i had missing values line before and after the actual points. i just want  connect the points with a line. 
.
Peshito
Telerik team
 answered on 15 Jun 2012
1 answer
120 views
Hi,

I am having some problems with a masked textbox in Google Chrome.
The code is:

<div style="float:left"><br>    <radI:RadMaskedTextBox ID="datetimePicker" runat="server" Mask="##/##/####" <br>        PromptChar="_" RoundNumericRanges="false" /><br></div>

The problem in Google Chrome(version 19.0.1084.56 m) is that the selectionStart value is not updated properly after inserting the values following "/" (see bug.png - the cursor should be after the 3 as is for IE and Mozila).

I am using RadControls for ASP.NET AJAX Q2 2011 SP1 and the RadInput.Net2.dll version is 1.4.3.0 .

Thank you
Vasil
Telerik team
 answered on 15 Jun 2012
1 answer
109 views
I have a someone complicated RadTreeView object with nodes in various formats. The top level nodes are created in the aspx.cs code behind, but the rest are created via a call to the same WebService function. The resulting child nodes may have a different appearance depending on the content.

What I would like to do is to adjust the hover and selected CSS classes on a per node basis so that the highlight covers the full height of the node. I cannot do this on a node-level basis because not all level 3 nodes (for example) have the same layout.

In the attached image, I have combined several TreeView screen captures to show how the highlighting currently appears for various nodes. The confusing part is that the top level node created in code behind has a hover highlight that coves the entire node height. I'd be glad to override the styles using declarations on the local aspx page--just couldn't find the right documentation.
Plamen
Telerik team
 answered on 15 Jun 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?