Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
65 views
Ahh, yes, I see it now.

It's been a long day already ;)


Danny
Top achievements
Rank 2
 asked on 15 Jun 2012
1 answer
473 views
need  create radgrid to dynamic way and also to export to Excel, but when exporting to excel only creates a blank file.

<telerik:RadGrid ID="rgCajas" runat="server" DataSourceID="odsCajas" OnSortCommand="rgCajas_SortCommand" OnPageIndexChanged="rgCajas_PageIndexChanged" OnPageSizeChanged="rgCajas_PageSizeChanged"
             AllowSorting="True" PageSize="15" AllowPaging="True" AllowMultiRowSelection="True" Gridlines="None" MasterTableView-NoMasterRecordsText="No se encontrĂ³ registro" Width="40%" DataSourcePersistenceMode="ViewState">
            
              <PagerStyle Mode="NextPrevAndNumeric" PagerTextFormat="{4} Registros {2}-{3} de {5}" PageSizeLabelText="# Registros"></PagerStyle>
           <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true">
                <Excel Format="ExcelML" />
            </ExportSettings>
            <MasterTableView DataSourceID="odsCajas" CommandItemDisplay="Top" AutoGenerateColumns="false" UseAllDataFields="true">
                   <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false" ShowRefreshButton="False" />
               <Columns>
               </Columns>
            </MasterTableView>
        </telerik:RadGrid>
        <asp:ObjectDataSource runat="server" ID="odsCajas" SelectMethod="GetCajaPorId"
                        TypeName="HQB.HQBDOC.HQBDocBLL.Orden.OrdenManagerBLL">
            <SelectParameters>
                <asp:ControlParameter ControlID="hfCajaId" DefaultValue="" Name="cajaId" PropertyName="Value" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
private void LoadData()
        {
            try{
                rgCajas.Columns.Clear();
                string cajas_query_attributes = GetVariableLocal("cajas.query.attributes");
                string[] arrCajas_query_attributes = cajas_query_attributes.Split(",".ToArray());
                for (int i = 0; i < arrCajas_query_attributes.Length; i++)
                {
                    string attibute = arrCajas_query_attributes[i].ToString();
                    string[] arrCajas_query_attributesField = attibute.Split("$".ToArray());
                    GridBoundColumn column = new GridBoundColumn();
                    column.HeaderText = arrCajas_query_attributesField[1];
                    column.DataField = arrCajas_query_attributesField[0];
                    rgCajas.MasterTableView.Columns.Add(column);
                }
            }
            catch (Exception ex)
            {
                //LOG.DE.ERRORES.
                LogManagerBLL.IngresarLog(LogConstante.ERROR, ex.Message, ex.StackTrace);
                throw ex;
            }
        }

this is how I load dynamically the columns I get from a local variable is an array of string.
do not know if this will be the right approach?
Daniel
Telerik team
 answered on 15 Jun 2012
3 answers
283 views
Hi,

I need to change the row background color in ItemDataBound but can't find how to get that.

If oDataItem.DataItem("isAnswer") = True Then
              ' Change the background color of the whole row
 End If

Many thanks in advance

Jon
Eyup
Telerik team
 answered on 15 Jun 2012
1 answer
151 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
929 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
126 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
92 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
178 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
214 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
75 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?