Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
1.2K+ views

We had an issue with the radconfirm popup which has to open on the click of delete image button which is present in the Telerik Radgrid template column.

Scenario:

Usually we call a callback function   and get the argument(Yes/NO) which user has selected.

In the call back function we used to get the reference of the button and then do a post back.

We tried the same approach here also, but since the Image button is inside the template column we are unable to get the reference in Javascript.

Question:

How to get the control id of a Image button which is present in a Telerik RadGrid in Javascript ?

Can you please help us on this
Princy
Top achievements
Rank 2
 answered on 24 Sep 2010
1 answer
143 views

aspx code

       <asp:Panel ID="TrendPanel" runat="server" Enabled="True">
           <telerik:radchart ID = "RadChart1" runat="server" Height = "780px" Width = "950px" Skin="Vista" >
             <Appearance Corners="Round, Round, Round, Round, 7">
                 <FillStyle FillType="ComplexGradient">
                     <FillSettings>
                         <ComplexGradient>
                             <telerik:GradientElement Color="243, 253, 255" />
                             <telerik:GradientElement Color="White" Position="0.5" />
                             <telerik:GradientElement Color="243, 253, 255" Position="1" />
                         </ComplexGradient>
                     </FillSettings>
                 </FillStyle>
                 <Border Color="212, 221, 222" />
             </Appearance>
</telerik:radchart>

c# code

private void UpdateRadChart(wchart wc)
  {
  
      string d1 = wc.d1.ToString("yyyy/MM/dd").Replace(".", "/");
      string d2 = wc.d2.ToString("yyyy/MM/dd").Replace(".", "/");
  
      TrendPanel.Visible = true;
      RadChart1.Visible = true;
  
      RadChart1.Series.Clear();
  
  
      RadChart1.Series.ClearItems();
  
      RadChart1.PlotArea.XAxis.Items.Clear();
      RadChart1.PlotArea.YAxis.Items.Clear();
      RadChart1.PlotArea.YAxis.ScaleBreaks.Segments.Clear();
  
  
  
      RadChart1.PlotArea.YAxis.ScaleBreaks.Enabled = false;
      RadChart1.PlotArea.YAxis.AutoScale = true;
      RadChart1.PlotArea.XAxis.AutoScale = true;
  
  
      RadChart1.PlotArea.YAxis.Appearance.LabelAppearance.Visible = true;
      RadChart1.PlotArea.XAxis.Appearance.LabelAppearance.Dimensions.AutoSize = false;
  
      RadChart1.AutoLayout = false;
      RadChart1.PlotArea.XAxis.Appearance.LabelAppearance.Dimensions.Height = Telerik.Charting.Styles.Unit.Pixel(15);
      RadChart1.PlotArea.XAxis.Appearance.LabelAppearance.Dimensions.Width = Telerik.Charting.Styles.Unit.Pixel(150);
      RadChart1.PlotArea.XAxis.Appearance.LabelAppearance.Position.AlignedPosition = AlignedPositions.Top;
        
        
      string type = wc.type;
        
  
      string sqlString = null;
      SqlConnection Conn = GetSqlConnection();
  
      if (type == "oil")
      {
          if (wc.well == 0) return;    
          sqlString = @"exec dbo.rwell " + "'" + d1 + "', '" + d2 + "', " + wc.well + ", 0";
  
          SqlDataAdapter adapter = new SqlDataAdapter(sqlString, Conn);
          DataSet ds = new DataSet();
          adapter.Fill(ds);
          ChartSeries currentSeries = null;
          currentSeries = RadChart1.CreateSeries("нефть, м3", Color.Empty, Color.Empty, ChartSeriesType.SplineArea);
          currentSeries.Appearance.Border.Color = Color.Black;
          currentSeries.Appearance.ShowLabels = false;
          currentSeries.Appearance.FillStyle.MainColor = Color.SaddleBrown;
          currentSeries.Appearance.FillStyle.SecondColor = Color.Black;
  
  
          RadChart1.ChartTitle.TextBlock.Text = "Тренд по результатам промежуточных замеров по скважине №" + wc.well.ToString();
          ChartAxisItem xAxis = new ChartAxisItem();
          RadChart1.PlotArea.XAxis.IsZeroBased = false;
          RadChart1.PlotArea.XAxis.AutoScale = false;
          RadChart1.PlotArea.XAxis.Appearance.CustomFormat = "dd.MM HH:mm";
          //RadChart1.PlotArea.XAxis.Appearance.MajorTick.Width = 90;
          RadChart1.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.ShortTime;
          RadChart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 90;
          RadChart1.PlotArea.XAxis.Appearance.LabelAppearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Top;
  
          foreach (DataRow dbRow in ds.Tables[0].Rows)
          {
  
              DateTime scDate = new DateTime();
              scDate = Convert.ToDateTime(dbRow["e"]);
              ChartAxisItem item = new ChartAxisItem();
              item.Value = (decimal)scDate.ToOADate();
              RadChart1.PlotArea.XAxis.AddItem(item);
  
              if (currentSeries != null)
              {
                  currentSeries.AddItem((double)dbRow["o"]);
              }
                
          }
  
          Conn.Close();
  
      }
      else if (type == "padu")
      {
          sqlString = @"exec dbo.cpadu " + "'" + d1 + "', '" + d2 + "', " + wc.bush + ", 0";
  
          SqlDataAdapter adapter = new SqlDataAdapter(sqlString, Conn);
          DataSet ds = new DataSet();
          adapter.Fill(ds);
  
          RadChart1.ChartTitle.TextBlock.Text = "Состояние ПАДУ по скважинам куста №" + wc.bush.ToString();
          ChartAxisItem xAxis = new ChartAxisItem();
            
          RadChart1.PlotArea.XAxis.IsZeroBased = false;
          RadChart1.PlotArea.XAxis.AutoScale = false;
          RadChart1.PlotArea.XAxis.Appearance.CustomFormat = "dd.MM HH:mm";
          RadChart1.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.ShortTime;
          RadChart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 90;
          RadChart1.PlotArea.XAxis.Appearance.LabelAppearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Top;
            
  
          int w = 0;
          int v = 0;
          ChartSeries currentSeries = null;
  
            
          RadChart1.PlotArea.YAxis.Appearance.LabelAppearance.Visible = false;
          RadChart1.PlotArea.YAxis.AutoScale = false; // это нужно чтобы вручную установить шкалу
  
  
          ChartAxisItem itemlast = null;
          int maxr = 0;
  
          foreach (DataRow dbRow in ds.Tables[0].Rows)
          {
  
              w = Convert.ToInt32(dbRow["w"]);
              v = Convert.ToInt32(dbRow["v"]);
              if (maxr < Convert.ToInt32(dbRow["r"]))
                  maxr = Convert.ToInt32(dbRow["r"]);
              DateTime scDate = new DateTime();
              scDate = Convert.ToDateTime(dbRow["t"]);
              ChartAxisItem item = new ChartAxisItem();
              item.Value = (decimal)scDate.ToOADate();
  
              if (itemlast == null)
                  RadChart1.PlotArea.XAxis.AddItem(item);
              else if (itemlast.Value != item.Value)
                 RadChart1.PlotArea.XAxis.AddItem(item);
  
  
              ChartSeriesItem itm = new ChartSeriesItem();
              itm.XValue = scDate.ToOADate();
  
  
              currentSeries = RadChart1.GetSeries(w.ToString()); // пытаемся найти серию по скважине, если не нашлась - создаем новую
              if (currentSeries == null)
              {
                  currentSeries = RadChart1.CreateSeries(w.ToString(), Color.Empty, Color.Empty, ChartSeriesType.Line);
                  currentSeries.Appearance.LineSeriesAppearance.Width = 3;
  
  
              }
              ChartSeriesItem im = null; // фиктивная точка для рисования лесенок
              if (currentSeries != null)
              {
                  if (v > 0)
                  {
                      if (v < 2) // для граничной фиктивной точки 0 устанавливать не нужно, если ПАДУ для скважины до этого была в работе
                      {
                          im = new ChartSeriesItem();
                          im.XValue = scDate.ToOADate();
                          im.YValue = 0;
                          currentSeries.Items.Add(im);
                      }
                      itm.YValue = double.Parse(dbRow["r"].ToString());
                  }
                  else
                  {
                      if (v == 0)
                      {
                          im = new ChartSeriesItem();
                          im.XValue = scDate.ToOADate();
                          im.YValue = double.Parse(dbRow["r"].ToString());
                          currentSeries.Items.Add(im);
                      }
                      itm.YValue = 0;
                  }
  
  
                  currentSeries.Items.Add(itm);
  
                  currentSeries.DefaultLabelValue = String.Empty;
  
  
              }
  
  
              itemlast = item;
  
          }
  
          RadChart1.PlotArea.YAxis.AddRange(0, maxr, 1); 
    
          Conn.Close();
  
      }

And this is result into attach.

Why this code doesn't work for my case? Why time stamps are cut?
RadChart1.PlotArea.XAxis.Appearance.LabelAppearance.Dimensions.Height = Telerik.Charting.Styles.Unit.Pixel(15); 
RadChart1.PlotArea.XAxis.Appearance.LabelAppearance.Dimensions.Width = Telerik.Charting.Styles.Unit.Pixel(150); 

Evgenia
Telerik team
 answered on 24 Sep 2010
3 answers
186 views
In the datatable in the rad chart I would like the values have a + sign if it is a positive number. Is that possible
Evgenia
Telerik team
 answered on 24 Sep 2010
1 answer
64 views
Can an admin please delete the posts that I submitted with the title "No InsertItemTemplate in RadGrid?" I don't know why, but, it kept failing when I tried to submit it. I didn't think it went through. So, I changed it and resubmitted it multiple times. Now I see the posts listed in the list, but, if you click on them, the pages don't display.
Tsvetoslav
Telerik team
 answered on 24 Sep 2010
1 answer
98 views
Group,
I have a RadGrid and I want to be able to hide the row of filters when I am in the OnEditcommand.  I can do it using Javascript by selecing radio buttons or clicking a button, but I just want it to automatically hide when in edit mode.

I tried using
gvProductionRuns.AllowFilteringByColumn = !gvProductionRuns.AllowFilteringByColumn;

but it causes issue with what record I am actually updating. I know there has to be an easy solution to this, but I am not finding it.

Any help is greatly appreciated!
Shinu
Top achievements
Rank 2
 answered on 24 Sep 2010
4 answers
79 views
I have  used RadTabStrip in my project its working fine.
But when i select any tab I want that tab should have some diffrent color and font?
thnks in advance.
nirbhay giri
Top achievements
Rank 1
 answered on 24 Sep 2010
4 answers
209 views
I have a toolbar in a user control which is ajaxified using the following declaration:

<telerik:RadAjaxManagerProxy ID="rap1" runat="server" > 
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="rtbActions">  
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="pnlFFV" LoadingPanelID="lpFFV" /> 
                <telerik:AjaxUpdatedControl ControlID="rtbActions" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManagerProxy>  

When certain toolbar buttons are clicked, controls are updated within a panel control (pnlFFV), and sometimes the toolbar itself is updated. This all works well, however, there is a button in the toolbar, which I want to cause a postback instead of an ajax update (this button is used to download a file and it is necessay to use the reponse object). I tried the following:

I added this script:


function realPostBack_FFV(eventTarget, eventArgument) {  
     $find("<%= rap1.ClientID %>").__doPostBack(eventTarget, eventArgument);  
} 

and in codebehind, I tried to wire it up to the particular toolbar button

For Each itm As RadToolBarButton In rtbActions.Items  
     If itm.Value = "Download" Then 
          itm.Attributes.Add("onclick", String.Format("realPostBack_FFV('{0}', ''); return false;", itm.UniqueID))  
     End If 
Next 

However, this button still causes an ajax update. can someone help me figure out how to exclude a particular toolbar button from an ajaxupdate if the rest of the toolbar is ajaxified?

P.S., I also tried modifying the javascript to reference the AjaxManager instead of the Proxy, like so:

function realPostBack_FFV(eventTarget, eventArgument) {     
     $find("<%= Me.MyAjaxManager.ClientID %>").__doPostBack(eventTarget, eventArgument);     
}    
 //Me.MyAjaxManager gets a reference to the shared AjaxManager in my base page class

But this dind't seem to make a difference.


Rich Coleman
Top achievements
Rank 1
 answered on 23 Sep 2010
2 answers
119 views
Hi,

I have a custom file upload code and i just wanted to add the Radprogress bar to monitor the fileupload progress.

Since its already a tested code and we have a release nearing we dont want to change to Radupload.

How do i monitor file upload progress?

Am using a simple file upload:
 <asp:FileUpload ID="fuRPFileSelect" runat="server" />
In the code behind  am using   fuRPFileSelect.SaveAs()  method for saving the file.

Thanks,
Mani
Manikandan Balasubramaniyan
Top achievements
Rank 1
 answered on 23 Sep 2010
13 answers
377 views
Hi Telerik Team,

I wanna know if the textbox of filter put out of the grid.

Please help me, thanks to all telerik team!
Pedro
Top achievements
Rank 1
 answered on 23 Sep 2010
2 answers
302 views
Hello,

There is an issue that users don't want to see the field alias in group header.
I tried to set it as "FieldAlias = ' '",  but it raised an error.
The error message is "Field definition is not valid. FieldAlias contains invalid characters"
Is it possible to reslove my issue? Thanks ahead.

Best regards
Chenghan
Justyn
Top achievements
Rank 1
 answered on 23 Sep 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?