Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
120 views
Hello, I have a grid-template-column defined like this( to save time and space i'll only put the column) :
<telerik:GridTemplateColumn HeaderText="Id" Reorderable="true" SortExpression="Id" UniqueName="Id" DataField="Id">
                    <ItemTemplate>
                        <asp:Label ID="lblId" runat="server" Text='<%# Eval("Id") %>' />
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadTextBox ID="txbId" Width="50px" runat="server" TextMode="SingleLine"
                            Text='<%# Bind("Id") %>' />
                    </EditItemTemplate>
                    <ItemStyle VerticalAlign="Top" />
             </telerik:GridTemplateColumn>

And I want on the PreRender event, to extract the value of this column

protected void RadGrid1_PreRender(object sender, System.EventArgs e)
    {
        //string selectedItem = ((GridDataItem)RadGrid1.SelectedItems[0])["Id"].Text;
        foreach (GridDataItem item in RadGrid1.Items)
        {
            //not working
            string k = item["Id"].Text;// is empty string
// null pointer
            string key = (item["Id"].TemplateControl.FindControl("txbId") as RadTextBox).Text;
}
The grid is already databinded! 

Any idea how to fix it? PLZ!!!

Thx a lot.

Alin
Top achievements
Rank 1
 answered on 09 May 2011
4 answers
170 views
Hello,

Im having a problem using a ToolTip in a Radgrid that has paging enabled. Everything works fine on the first page, but just fails to work at the other pages. I have tried several things like checking the itemIndex + pagesize and on what i currently am.

I can not supply all the code, but this should do it. Its about the tooltip manager i think. ItemDataBound triggers the FillData.

private void FillData(GridItem repItem)
   {
 
           if (repItem.ItemType == Telerik.Web.UI.GridItemType.AlternatingItem || repItem.ItemType == Telerik.Web.UI.GridItemType.Item)
            {
                NameView nameView= (NameView) repItem.DataItem;
 
   
                pnlImage.ID = nameView.Id.ToString();
 
                    if (this.EnableMouseOver)
                    {
                      tooltipManager.TargetControls.Add(pnlImage.ClientID, nameView.Id.ToString(), true);
                    }
               }
           }  
    }

Im pretty sure its a small thing i am missing.

Ive also used this around it.

if (_itemIndex >= (_currentPage * repItem.OwnerTableView.PageSize))
 {
     if (this.EnableMouseOver)
     {
       tooltipManager.TargetControls.Add(pnlImage.ClientID, nameView.Id.ToString(), true);
     }
}
 _itemIndex++;

The OnAjaxUpdate works fine since it works on the first page of the grid.

<telerikAjax:RadToolTipManager ID="tooltipManager" runat="server" AnimationDuration="300" Animation="Fade" ShowDelay="500"
    EnableShadow="true" HideDelay="1"
    Position="TopRight" ShowCallout="false" RelativeTo="Element" OnAjaxUpdate="OnAjaxUpdate"
    Width="372px" Height="330px" OnClientBeforeShow="clientBeforeShow">
</telerikAjax:RadToolTipManager>

Guido S
Top achievements
Rank 1
 answered on 09 May 2011
1 answer
141 views
Hello,

I am using the latest version of controls. Observed that the text on the chart is blured. These charts are placed in radDock controls.

Is there any compression effect which makes the text blur ?
What could be the reason and how to fix this issue ?

Code used to create the chart at runtime:
Protected Sub loadChart(ByVal dtStartDate As String, ByVal dtEndDate As String)
        Dim objReportEditChart As New Toolkit.Report
        objReportEditChart = getReport("CSMD_Average_Response_Time")
  
        Try
            Dim ds As New DataSet
            Dim da = New SqlDataAdapter(objReportEditChart._Query + "'" + dtStartDate + "', '" + dtEndDate + "')", strDSN)
            da.Fill(ds)
  
            rc_CSMD_Average_Response_Time.RemoveAllSeries()
  
            Dim sr_Days As New ChartSeries("Days", ChartSeriesType.Bar)
            rc_CSMD_Average_Response_Time.Series.Add(sr_Days)
  
            list.Clear()
            list.Add("HH:MM")
            Dim dr As DataRow() = ds.Tables(0).[Select]("severity='Severity 1'")
            If dr.Count > 0 Then
                sr_Days.AddItem(Convert.ToDecimal(dr(0).ItemArray(2).ToString()))
                list.Add(dr(0).ItemArray(0).ToString() + ":" + dr(0).ItemArray(1).ToString())
            Else
                sr_Days.AddItem(0)
                list.Add("0:0")
            End If
  
            dr = ds.Tables(0).Select("severity='Severity 2'")
            If dr.Count > 0 Then
                sr_Days.AddItem(Convert.ToDecimal(dr(0).ItemArray(2).ToString()))
                list.Add(dr(0).ItemArray(0).ToString() + ":" + dr(0).ItemArray(1).ToString())
            Else
                sr_Days.AddItem(0)
                list.Add("0:0")
            End If
  
            dr = ds.Tables(0).Select("severity='Severity 3'")
            If dr.Count > 0 Then
                sr_Days.AddItem(Convert.ToDecimal(dr(0).ItemArray(2).ToString()))
                list.Add(dr(0).ItemArray(0).ToString() + ":" + dr(0).ItemArray(1).ToString())
            Else
                sr_Days.AddItem(0)
                list.Add("0:0")
            End If
  
            dr = ds.Tables(0).Select("severity='Severity 4'")
            If dr.Count > 0 Then
                sr_Days.AddItem(Convert.ToDecimal(dr(0).ItemArray(2).ToString()))
                list.Add(dr(0).ItemArray(0).ToString() + ":" + dr(0).ItemArray(1).ToString())
            Else
                sr_Days.AddItem(0)
                list.Add("0:0")
            End If
  
            'Dim barColors As Color() = New Color() {Color.Yellow, Color.Red, Color.Yellow, Color.Green, Color.SteelBlue}
            Dim barColors As String() = New String() {"#FFFFFF", "#7F0000", "#FFDD59", "#267F00", "#005999"}
            Dim i As Integer = 0
            For Each item As ChartSeriesItem In rc_CSMD_Average_Response_Time.Series(0).Items
                item.Appearance.FillStyle.MainColor = System.Drawing.ColorTranslator.FromHtml(barColors(System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1))) ''barColors(System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1))
                item.Appearance.FillStyle.FillType = Styles.FillType.Solid
            Next
  
            rc_CSMD_Average_Response_Time.PlotArea.XAxis.Appearance.MajorGridLines.Visible = True
            rc_CSMD_Average_Response_Time.PlotArea.XAxis.Appearance.MajorGridLines.PenStyle = Drawing2D.DashStyle.Dash
            rc_CSMD_Average_Response_Time.PlotArea.XAxis.Appearance.MajorGridLines.Color = Color.DarkGray
            rc_CSMD_Average_Response_Time.PlotArea.YAxis.Appearance.MajorGridLines.Visible = True
            rc_CSMD_Average_Response_Time.PlotArea.YAxis.Appearance.MajorGridLines.PenStyle = Drawing2D.DashStyle.Dash
            rc_CSMD_Average_Response_Time.PlotArea.YAxis.Appearance.MajorGridLines.Color = Color.DarkGray
            rc_CSMD_Average_Response_Time.PlotArea.Appearance.Border.Visible = False
            rc_CSMD_Average_Response_Time.Appearance.Border.Visible = False
            rc_CSMD_Average_Response_Time.Height = System.Web.UI.WebControls.Unit.Pixel(255)
            rc_CSMD_Average_Response_Time.Width = System.Web.UI.WebControls.Unit.Pixel(255)
            rc_CSMD_Average_Response_Time.Appearance.Border.Color = System.Drawing.ColorTranslator.FromHtml("#4C4C4C")
            rc_CSMD_Average_Response_Time.SeriesOrientation = ChartSeriesOrientation.Vertical
            rc_CSMD_Average_Response_Time.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Color = System.Drawing.ColorTranslator.FromHtml("#4C4C4C")
            rc_CSMD_Average_Response_Time.PlotArea.YAxis.Appearance.TextAppearance.TextProperties.Color = System.Drawing.ColorTranslator.FromHtml("#4C4C4C")
  
            Dim t1 As Telerik.Charting.ChartXAxis = rc_CSMD_Average_Response_Time.PlotArea.XAxis
            t1.Appearance.TextAppearance.TextProperties.Font = New System.Drawing.Font("Verdana", 7.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 1, False)
            t1.AxisLabel.TextBlock.Appearance.TextProperties.Font = New System.Drawing.Font("Verdana", 7.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 1, False)
            t1.AxisLabel.TextBlock.Appearance.TextProperties.Color = System.Drawing.ColorTranslator.FromHtml("#4C4C4C")
            Dim t2 As Telerik.Charting.ChartYAxis = rc_CSMD_Average_Response_Time.PlotArea.YAxis
            t2.Appearance.TextAppearance.TextProperties.Font = New System.Drawing.Font("Verdana", 7.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 1, False)
            t2.AxisLabel.TextBlock.Appearance.TextProperties.Font = New System.Drawing.Font("Verdana", 7.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 1, False)
            t2.AxisLabel.TextBlock.Appearance.TextProperties.Color = System.Drawing.ColorTranslator.FromHtml("#4C4C4C")
  
            rc_CSMD_Average_Response_Time.Series(0).Appearance.TextAppearance.TextProperties.Font = New System.Drawing.Font("Verdana", 7.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 1, False)
            rc_CSMD_Average_Response_Time.Series(0).Appearance.TextAppearance.TextProperties.Color = System.Drawing.ColorTranslator.FromHtml("#4C4C4C")
            rc_CSMD_Average_Response_Time.Series(0).Appearance.Border.Color = System.Drawing.ColorTranslator.FromHtml("#4C4C4C")
            rc_CSMD_Average_Response_Time.Series(0).Appearance.Border.Width = 1
  
            'rc_CSMD_Average_Response_Time.PlotArea.XAxis.AxisLabel.Visible = True
            'rc_CSMD_Average_Response_Time.PlotArea.XAxis.AxisLabel.Appearance.Position.AlignedPosition = Styles.AlignedPositions.BottomRight
            'rc_CSMD_Average_Response_Time.PlotArea.XAxis.AxisLabel.TextBlock.Text = "SEVERITY"
            rc_CSMD_Average_Response_Time.PlotArea.YAxis.AxisLabel.Visible = True
            'rc_CSMD_Average_Response_Time.PlotArea.YAxis.AxisLabel.Appearance.Position.AlignedPosition = Styles.AlignedPositions.TopLeft
            rc_CSMD_Average_Response_Time.PlotArea.YAxis.AxisLabel.TextBlock.Text = "DAYS"
  
            rc_CSMD_Average_Response_Time.AutoLayout = True
            rc_CSMD_Average_Response_Time.IntelligentLabelsEnabled = True
            rc_CSMD_Average_Response_Time.ChartTitle.Visible = False
            rc_CSMD_Average_Response_Time.Legend.Visible = False
            rc_CSMD_Average_Response_Time.PlotArea.XAxis.AutoScale = False
            rc_CSMD_Average_Response_Time.Skin = "Vista"
            rc_CSMD_Average_Response_Time.PlotArea.Appearance.FillStyle.MainColor = Color.White
            rc_CSMD_Average_Response_Time.PlotArea.Appearance.FillStyle.SecondColor = Color.White
            rc_CSMD_Average_Response_Time.PlotArea.Appearance.FillStyle.FillType = Styles.FillType.Gradient
            rc_CSMD_Average_Response_Time.Appearance.FillStyle.MainColor = Color.White
            rc_CSMD_Average_Response_Time.Appearance.FillStyle.SecondColor = Color.White
            rc_CSMD_Average_Response_Time.Appearance.FillStyle.FillType = Styles.FillType.Gradient
            rc_CSMD_Average_Response_Time.PlotArea.YAxis.AxisMode = ChartYAxisMode.Extended
            rc_CSMD_Average_Response_Time.PlotArea.XAxis.Clear()
            rc_CSMD_Average_Response_Time.PlotArea.XAxis.AddItem("SEV 1")
            rc_CSMD_Average_Response_Time.PlotArea.XAxis.AddItem("SEV 2")
            rc_CSMD_Average_Response_Time.PlotArea.XAxis.AddItem("SEV 3")
            rc_CSMD_Average_Response_Time.PlotArea.XAxis.AddItem("SEV 4")
  
            arrHeader(0) = "SEV"
            arrHeader(1) = "SEV1"
            arrHeader(2) = "SEV2"
            arrHeader(3) = "SEV3"
            arrHeader(4) = "SEV4"
            arrData(0) = list(0).ToString()
            arrData(1) = list(1).ToString()
            arrData(2) = list(2).ToString()
            arrData(3) = list(3).ToString()
            arrData(4) = list(4).ToString()
  
        Catch ex As SqlException
            Console.WriteLine("SQL exception occurred: " & ex.Message)
        End Try
    End Sub
Tsvetie
Telerik team
 answered on 09 May 2011
1 answer
53 views

Hello,
I wrote this question in another thread, but i did get an answer,
maybe, because it was a different subject:

my grid (8 items) is with paging (PageSize = 5),
but i have two problems:
1) when i do 'for each' on the grid items , the "RadGrid1.Items.Count" equals - 5 and not 8
and then i get a message:
 "index was out of range. must be non negative and less then the size of the collection. parameter name : index"
2) when i add a new record - i dont see it because it's at an other page,
how can i make it go to the last page - where the new item is?

thanks in advance.

Pavlina
Telerik team
 answered on 09 May 2011
6 answers
203 views
If a RadMenu is rendered, the top div has a "float: left" style. Why has Telerik chosen to do so?

I have just started to use the controls. However, when think about scenarios with the RadMenu, I believe that most of the time the RadMenu will be a block in the top of a web page. So "float: left" is more an annoyance than a benefit.

I do know that I can overrule the floating in my own CSS. I just want to understand, why the floating was chosen.

Michael G. Schneider
mgs
Top achievements
Rank 1
 answered on 09 May 2011
3 answers
201 views
Hey guys

I'm new to telerik and I'm facing a big problem. I'm developping a web application and I need, when I click on a button, to make appears a new window (window B) inside the current window (windows A). So, I followed this demo http://demos.telerik.com/aspnet-ajax/fileexplorer/examples/client-sideapi/fileselectordialog/defaultcs.aspx, but there's still a problem. The window B appears over the window A, but I can drag it "out" of the windows A and a scrollbar appears. So, I tried to put a RestrictionZoneID (using css) that will block the window B at the edge of the window A by using the current resolution of the screen, but I don't know how to find the resolution in css. Can someone help me ? In fact, the best would be that my window have the same behavior that any Microsoft window.
Marin Bratanov
Telerik team
 answered on 09 May 2011
3 answers
101 views
We have integrated our registration web page with rad captcha control. Its working fine in most of the desktops. But in some desktops the page is not all loading it is showing "downloading 1 item". When we remove the audio captcha functionality there, its working fine. Please can anyone help in solving the issue.
Pero
Telerik team
 answered on 09 May 2011
4 answers
272 views
We have a site that we precompile using Visual Studio 2008.  We go to Build > Publish Web Site to build the DLL and COMPILE files for our precompiled website.  The only checkbox we have checked on this page is "Use fixed naming and single page assemblies".  Until this last upgrade from 2010.1.509.35 to 2010.3.1215.35 we have had no issues when trying to update individual precompiled pages.  For example if we make changes to Default.aspx and then precompile it into default.aspx.######.compiled and App_Web_Default.aspx.######.dll we were able to take these two files and put them into the bin directory on our production server.  Thus elimnating the need to update the entire bin folder for every single update. 

It seems however that recently if we are using 2010.3.1215.35 in our deveolpment environment, precompile our pages, and put them on the production server (which has the 2010.1.509.35 dll's) we are getting issues.  In particular the "File has not been pre-compiled, and cannot be requested". 

To reproduce this error in it's simplest form I created two WebApplications each with just one Default.aspx page.  Site1 and Site2.  I use the Q1 release in Site1 and Q3 release in Site2.  I then precompile both of these sites.  When I copy the precompiled default files (.dll and .compiled) from Site2 to Site1 we get the error described above.  We have not had these issues previously and I am hoping you can provider assistance. I tried to attach the two sites for your convenience, but am only able to attach images.

Thank You
Maria Ilieva
Telerik team
 answered on 09 May 2011
3 answers
104 views
Ok. I have a grid which is a list of tests for patients. It has two grid check columns at the end to allow selection for either male, female or both for each row.

I need to be able to allow the checkboxes to be editable immediately on load.

I have used  -

e.Item.Edit = True in itemcreated and allowed multiple row edits in the mastetableview.

If I use form edit you can change the values of the checkboxes in the form. If I use inplace edit the checkboxes are disabled.

Really stuck with this. Either a bug with inline or I am doing something totally wrong.

Any ideas?

Tox
Toxic
Top achievements
Rank 1
 answered on 09 May 2011
2 answers
185 views
Hi,

I am trying out Telerik Controls for a potentially large projecy. As part of it, I am designing a line chart and made the x-axis rotation to -90, removed legend etc. The problem is the x-axis labels are overlapping the plot area and I can't seem to figure this out.

Attached is the image.

Please help.

Thanks
Ananth

<telerik:RadChart ID="linkchart" runat="server" Height="400px" Skin="Office2007"
    Width="925px" DefaultType="Line" IntelligentLabelsEnabled="True">
    <Appearance>
        <Border Color="134, 134, 134" />
    </Appearance>
    <Series>
        <telerik:ChartSeries Name="Series 1" Type="Line">
            <Appearance>
                <FillStyle FillType="Solid" MainColor="69, 115, 167">
                </FillStyle>
                <TextAppearance TextProperties-Color="Black">
                </TextAppearance>
                <Border Color="69, 115, 167" />
            </Appearance>
        </telerik:ChartSeries>
    </Series>
    <Legend Visible="False">
        <Appearance Dimensions-Margins="15%, 2%, 1px, 1px" Dimensions-Paddings="2px, 8px, 6px, 3px"
            Visible="False">
            <ItemTextAppearance TextProperties-Color="Black">
            </ItemTextAppearance>
            <ItemMarkerAppearance Figure="Square">
            </ItemMarkerAppearance>
        </Appearance>
    </Legend>
    <PlotArea>
        <XAxis>
            <Appearance Color="134, 134, 134" MajorTick-Color="134, 134, 134" LabelAppearance-RotationAngle="-90">
                <MajorGridLines Color="134, 134, 134" Width="0" />
                <LabelAppearance RotationAngle="-90">
                </LabelAppearance>
                <TextAppearance TextProperties-Color="Black" Position-AlignedPosition="None">
                </TextAppearance>
            </Appearance>
            <AxisLabel>
                <Appearance Position-AlignedPosition="Bottom">
                </Appearance>
                <TextBlock>
                    <Appearance TextProperties-Color="Black" Position-AlignedPosition="Bottom">
                    </Appearance>
                </TextBlock>
            </AxisLabel>
        </XAxis>
        <YAxis>
            <Appearance Color="134, 134, 134" MajorTick-Color="134, 134, 134" MinorTick-Color="134, 134, 134">
                <MajorGridLines Color="134, 134, 134" />
                <MinorGridLines Color="134, 134, 134" />
                <TextAppearance TextProperties-Color="Black">
                </TextAppearance>
            </Appearance>
            <AxisLabel>
                <TextBlock>
                    <Appearance TextProperties-Color="Black">
                    </Appearance>
                </TextBlock>
            </AxisLabel>
        </YAxis>
        <Appearance Dimensions-Margins="25px, 25px, 75px, 75px">
            <FillStyle FillType="Solid" MainColor="">
            </FillStyle>
        </Appearance>
    </PlotArea>
    <ChartTitle Visible="False">
        <Appearance Visible="False">
            <FillStyle MainColor="">
            </FillStyle>
        </Appearance>
        <TextBlock>
            <Appearance TextProperties-Color="Black" TextProperties-Font="Arial, 18px">
            </Appearance>
        </TextBlock>
    </ChartTitle>
</telerik:RadChart>
Ananth Godavari
Top achievements
Rank 1
 answered on 09 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?