Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
74 views

Hi,

I was wondering if there is a way to determine the underlying SQL that is sent to the database. So I have a SQLDataSource with a Slect Statement of
 Select name from User where UserId = @Userid

Is it possible to see the final statement that is sent to the database? So I would see "Select name from User where UserId = 1" ?

As in SqlDataSource.SelectStatement(); or some equivalent to this?

All I can see is the SelectCommand and SelectParameters

Would I have to put those 2 together myself?

Ken
Top achievements
Rank 1
 asked on 16 May 2012
6 answers
304 views
Hej, im using ur example :
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/savinggridsettingsonperuserbasis/defaultcs.aspx

 

 

My problem is that when I'm getting the column.headerStyle.width is not the right ones. What i mean by that is that only the resized column acctualy changes width value where the others just keep having the same as before resizing´, even if they do acctually change like f.eks in the example, but its probally just visual in my case.

what do I do wrong?

Here is my savesettings string:



private
string SaveSettings()  

object[] gridSettings = new object[3];  

//Save groupBy 

 

GridGroupByExpressionCollection groupByExpressions = gridInstance.MasterTableView.GroupByExpressions; 

object[] groupExpressions = new object[groupByExpressions.Count];  


int
count = 0; 

 

foreach(GridGroupByExpression expression in groupByExpressions)  

{

groupExpressions[count] = ((IStateManager)expression).SaveViewState();

count++;

}

gridSettings[0] = groupExpressions;

 

//Save sort expressions

 

gridSettings[1] = ((

IStateManager)gridInstance.MasterTableView.SortExpressions).SaveViewState();  

 

//Save columns order 

 

 

int columnsLength = gridInstance.MasterTableView.Columns.Count + gridInstance.MasterTableView.AutoGeneratedColumns.Length;

 

Pair [] columnOrder = new Pair[ columnsLength ];  

ArrayList allColumns = new ArrayList( columnsLength );

 

allColumns.AddRange(gridInstance.MasterTableView.Columns );

allColumns.AddRange(gridInstance.MasterTableView.AutoGeneratedColumns);

 
int i = 0;  

foreach( GridColumn column in allColumns ) 

{
Pair p = new Pair(); 

p.First = column.OrderIndex;

p.Second = column.HeaderStyle.Width;

columnOrder[i] = p; 

i++;

}

gridSettings[2] = columnOrder;
 

// Serialize and return  

 

LosFormatter formatter = new LosFormatter();  

StringWriter writer = new StringWriter();

formatter.Serialize( writer, gridSettings ); 

return writer.ToString(); 

}

Regards,
Mircea

Joshua
Top achievements
Rank 1
 answered on 16 May 2012
3 answers
137 views
I'm trying to load one image for all rows in my radgrid, however, all i'm able to get to appear is the alternate text.  The code below is what I'm using:

                        <telerik:GridImageColumn DataType="System.String" DataImageUrlFields="ValletImage"
                            DataImageUrlFormatString="images/{0}.jpeg" AlternateText="Customer image" DataAlternateTextField="ContactName"
                            ImageAlign="Middle" ImageHeight="110px" ImageWidth="90px" HeaderText="Vallet"
                            FooterText="Vallet" ImageUrl="~/vallet.aspx?={0}" />

My datarow produces ValletImages = "mypicture" for each picture.  In this case all my rows appear as "smallpic", i'm expecting it to look for images/mypicture.jpeg but it refuses to load.

Do I have it wrong or is there something I need to change?  Also, i am trying to have a specific URL per picture.

Thanks
Richard
Top achievements
Rank 1
 answered on 16 May 2012
2 answers
823 views
I've been trying all day without asking, but i give up.  If anybody can help me with this I would appreciate it.

Here is how much chart looks.

My chart

There are the issues I need help with.

    The labels on the left I have figured how to format, however, they are being cut off.  How do I shift the everything right so the labels are there?
    The next issue is how do I actually format the data as currency itself? (300119,302519 I would like to be $300,119,$302,519)
    How do I actually format the date as a real date on the graph?  For example 5082012 should be 5/08/2012.
    Is there a way to hide the series labels? for example the $$$ and Date?



Here is the code i'm using.  I might be weird but I prefer to do everything in behind code, so if there is a solution that way I would love it!  Hopefully this is easy!

private void BindChart2()
    {
        string[] ParamArgs = { "DealershipIdParam|DemoDealership" };
        DataTable ChartTable2 = MySQLProcessing.MySQLProcessor.StoreProcedureDTTable("CarLot_Dealership_Total_Listing_Value", ParamArgs, "CarLot_Dealership_Total_Listing_Value");
        DataTable MinTable = MySQLProcessing.MySQLProcessor.StoreProcedureDTTable("CarLot_Dealership_Min_Listing_Value", ParamArgs, "CarLot_Dealership_Min_Listing_Value");
        DataTable MaxTable = MySQLProcessing.MySQLProcessor.StoreProcedureDTTable("CarLot_Dealership_Max_Listing_Value", ParamArgs, "CarLot_Dealership_Max_Listing_Value");


        RadChart2.DataSource = ChartTable2;
        RadChart2.PlotArea.XAxis.AxisLabel.Visible = true;
        RadChart2.PlotArea.YAxis.AxisLabel.Visible = true;
        RadChart2.PlotArea.XAxis.DataLabelsColumn = "Date";
        RadChart2.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = -45;
        string[] min = MinTable.Rows[0].ItemArray[0].ToString().Split('.');
        string[] max = MaxTable.Rows[0].ItemArray[0].ToString().Split('.');
        RadChart2.PlotArea.YAxis.MinValue = Convert.ToInt32(min[0]);
        RadChart2.PlotArea.YAxis.MaxValue = Convert.ToInt32(max[0]);
        RadChart2.PlotArea.YAxis.Step = 1000;
        RadChart2.PlotArea.YAxis.AutoScale = false;
        RadChart2.PlotArea.XAxis.AxisLabel.TextBlock.Appearance.TextProperties.Font = new System.Drawing.Font("Verdana", 6, System.Drawing.FontStyle.Bold);
        RadChart2.PlotArea.YAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.Currency;
        //RadChart2.PlotArea.Appearance.Dimensions.Margins.Right = Telerik.Charting.Styles.Unit.Pixel(-400);
        //RadChart2.PlotArea.YAxis.AutoScale = true;
        //RadChart2.AutoLayout = true;
        RadChart2.DataBind();




<telerik:RadChart ID="RadChart2" runat="server" ChartImageFormat="Jpeg"
                  Skin="Metal" DefaultType="Line" Width="600px">
                  <Appearance Corners="Round, Round, Round, Round, 10">
                      <FillStyle FillType="Image">
                          <FillSettings BackgroundImage="{chart}" ImageDrawMode="Flip">
                          </FillSettings>
                      </FillStyle>
                      <Border Color="111, 111, 111" />
                  </Appearance>
                  <Legend Visible="False">
                      <Appearance Dimensions-Margins="16%, 3%, 1px, 1px"
                          Position-AlignedPosition="TopRight" Visible="False">
                          <ItemTextAppearance TextProperties-Color="Black">
                          </ItemTextAppearance>
                          <FillStyle MainColor="Transparent">
                          </FillStyle>
                          <Border Color="Transparent" />
                      </Appearance>
                  </Legend>
                  <PlotArea>
                      <DataTable Visible="True">
                      </DataTable>
                      <EmptySeriesMessage Visible="True">
                          <Appearance Visible="True">
                          </Appearance>
                      </EmptySeriesMessage>
                      <XAxis>
                          <Appearance Color="Transparent" MajorTick-Color="174, 174, 174">
                              <MajorGridLines Color="40, 255, 255, 255" PenStyle="Solid" />
                              <TextAppearance TextProperties-Color="51, 51, 51">
                              </TextAppearance>
                          </Appearance>
                          <AxisLabel>
                              <TextBlock Text="Date">
                                  <Appearance TextProperties-Color="51, 51, 51">
                                  </Appearance>
                              </TextBlock>
                          </AxisLabel>
                      </XAxis>
                      <YAxis AutoScale="False" MaxValue="100" MinValue="0" Step="10">
                          <Appearance Color="Transparent" MajorTick-Color="174, 174, 174"
                              MinorTick-Color="174, 174, 174">
                              <MajorGridLines Color="40, 255, 255, 255" />
                              <MinorGridLines Color="40, 255, 255, 255" />
                              <TextAppearance TextProperties-Color="51, 51, 51">
                              </TextAppearance>
                          </Appearance>
                          <AxisLabel>
                              <TextBlock Text="$$$">
                                  <Appearance TextProperties-Color="51, 51, 51">
                                  </Appearance>
                              </TextBlock>
                          </AxisLabel>
                      </YAxis>
                      <Appearance Corners="Round, Round, Round, Round, 4">
                          <FillStyle FillType="Image">
                              <FillSettings BackgroundImage="{plotarea}" ImageAlign="Top"
                                  ImageDrawMode="Flip" ImageFlip="FlipY">
                              </FillSettings>
                          </FillStyle>
                          <Border Color="174, 174, 174" Width="4" />
                      </Appearance>
                  </PlotArea>
                  <ChartTitle>
                      <Appearance Position-AlignedPosition="Top">
                          <FillStyle MainColor="Transparent">
                          </FillStyle>
                      </Appearance>
                      <TextBlock Text="Total Listing Monetary Value">
                          <Appearance TextProperties-Font="Arial, 16pt">
                          </Appearance>
                      </TextBlock>
                  </ChartTitle>
              </telerik:RadChart>

mysql produces

$$$    Date
300119    05082012
302519    05092012
302819    05102012
305219    05112012

i would prefer it to produce
$$$    Date
300119    05/08/2012
302519    05/09/2012
302819    05/10/2012
305219    05/11/2012


Thanks!!!
Evgenia
Telerik team
 answered on 16 May 2012
2 answers
414 views
Hello, please I need help. I need to change a diferent color for each item that I already databinded in a radlistbox. It doesnt matter if it's from the server or the client side. In addition Can I make separations like a radgrid in a Radlistbox?Thank You
Victor
Top achievements
Rank 1
 answered on 16 May 2012
2 answers
130 views
Hello, i have a radTabStrip with a radmultipage (and radpageview) inside. I put the radajaxmanager for show the loadingpanel when the page inside of the multipage loading but, the loading panel only appear a few second and hide when the page still does not load completely.


Here's my code...

TTabStrip.ascx 

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TTabStrip.ascx.cs" Inherits="OmegaWeb.WebControls.Seguridad.TTabStrip" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<telerik:RadAjaxLoadingPanel runat="server" ID="LoadingPanel1" Height="75px" Width="75px">
</telerik:RadAjaxLoadingPanel>
<telerik:RadTabStrip ID="RadTabStrip1" SelectedIndex="0"
    CssClass="tabStrip" runat="server" MultiPageID="RadMultiPage1" Skin="Default"
    AutoPostBack="true" ShowBaseLine="True"
    ClickSelectedTab="True" ontabclick="RadTabStrip1_TabClick" >
</telerik:RadTabStrip>
<telerik:RadAjaxManager runat="server" ID="RadAjaxManagerProxy1">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadTabStrip1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
                <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="RadMultiPage1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
                <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" EnableEmbeddedScripts="true">
    <telerik:RadPageView ID="RadPageView1" runat="server">
    </telerik:RadPageView>
</telerik:RadMultiPage>

CODE BEHIND
public partial class TTabStrip : System.Web.UI.UserControl
   {
       protected void Page_Load(object sender, System.EventArgs e)
       {
           if (!Page.IsPostBack)
           {
               DrillDownModel drillDown = GenericController<DrillDownModel>.Current;
               List<TabStripModel> tabs = SecurityInfo.GetTabStripsUsuario(drillDown);
 
               if (!SecurityInfo.HasAccessToDrillDown(drillDown))
               {
                   NotifyNoAccess(drillDown);
                   Server.Transfer("/NoAccessPage.aspx", false);
                   return;
               }
 
               tabs.ForEach(tab => AddTab(tab.Texto, tab.TargetDrillDownId == 0 ? tab.URL :
                   string.Format("/WebForms/DrillDown/DrillDownRedirect.aspx?TS={0}", tab.Id)));
               setPersistTab();
               
           }
 
       }
 
       private void setPersistTab()
       {
           string sessionTabId = string.Format("DrillDown_{0}", GenericController<DrillDownModel>.CurrentId);
           string tabName;
           if (HttpContext.Current.Session[sessionTabId] != null)
           {
               tabName = HttpContext.Current.Session[sessionTabId].ToString();
               RadTab tab = RadTabStrip1.FindTabByText(tabName);
               if (tab != null)
               {
                   tab.Selected = true;
                   RadPageView1.ContentUrl = tab.Value;
               }
           }
           else
           {
               RadTab tab = RadTabStrip1.Tabs.FirstOrDefault();
               if (tab != null)
               {
                   tab.Selected = true;
                   RadPageView1.ContentUrl = tab.Value;
               }
           }
 
       }
 
       private void AddTab(string tabName, string tabValue)
       {
           RadTab tab = new RadTab(tabName, tabValue);
           RadTabStrip1.Tabs.Add(tab);
       }
 
       private void NotifyNoAccess(DrillDownModel drilldown)
       {
           MailMessage mail = new MailMessage();
           mail.From = new MailAddress("Omega@uai.cl");
           mail.To.Add(ConfigurationManager.AppSettings["Omega Team"]);
           mail.Subject = "Acceso DrillDown - Omega";
           mail.IsBodyHtml = false;
           StringBuilder body = new StringBuilder();
           body.AppendLine(string.Format("DrillDownId:{0}", drilldown.Id));
           body.AppendLine(string.Format("Nombre DrillDown:{0}", drilldown.Titulo));
           body.AppendLine(string.Format("UsuarioId: {0}", SecurityInfo.LoginUser.Id));
           body.AppendLine(string.Format("Usuario: {0}", SecurityInfo.LoginUser.GetPersonaRef()._ApellidosNombre));
           body.AppendLine(string.Format("AUTH_USER: {0}", Request.ServerVariables["AUTH_USER"]));
           body.AppendLine(string.Format("LOGON_USER: {0}", Request.ServerVariables["LOGON_USER"]));
           body.AppendLine(string.Format("REMOTE_USER: {0}", Request.ServerVariables["REMOTE_USER"]));
           body.AppendLine(string.Format("REMOTE_ADDR: {0}", Request.ServerVariables["REMOTE_ADDR"]));
           body.AppendLine(string.Format("REMOTE_HOST: {0}", Request.ServerVariables["REMOTE_HOST"]));
           body.AppendLine(string.Format("SERVER_NAME: {0}", Request.ServerVariables["SERVER_NAME"]));
 
           mail.Body = body.ToString();
 
           SmtpClient smtp = new SmtpClient(ConfigurationManager.AppSettings["SMTPServer"]);
           smtp.Send(mail);
       }
 
       protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
       {
 
           string sessionTabId = string.Format("DrillDown_{0}", GenericController<DrillDownModel>.CurrentId);
           HttpContext.Current.Session[sessionTabId] = e.Tab.Text;
 
           RadPageView1.ContentUrl = e.Tab.Value;
           RadPageView1.ResolveUrl(e.Tab.Value);
       }
 
 
   }


Orlando.
Orlando
Top achievements
Rank 1
 answered on 16 May 2012
4 answers
160 views
Hi,

I'm new to the Telerik controls and I'm using Entity Framework. I'm wondering how I can use my insert stored procedure for the insert command of my rad grid? I've seen documentation on how to do manual CRUD via SQLDataSource, but I'm looking for a way to avoid that and use my EF procedure instead.

Fairly new to EF, too, so if anyone has experience implementing this successfully I'd appreciate the help.

Thanks,
Nick 
Andrey
Telerik team
 answered on 16 May 2012
1 answer
187 views
I started playing with the Kendo DataViz for a mobile "Andon" display on a variety of devices (Android Tablet, Black Berry, IPhone, Windows).

I was really impressed with how quick I could get a chart to appear on all devices (I spent about an hour, and most of that was reading documentation).  So now, I am looking at my next steps in terms of a general solution, and that is where my questions come in.

1. What is the time frame for seeing the .Net class wrappers for Kendo so that we can control the Kendo UI/Data Viz elements at the server HTTP GET time?  E.g. if certain conditions occur, can I control the chart being rendered to the client?

2. Is there a way to aggregate data from a dataSource of type transport?  E.g. Suppose I have a list of orders with customer information and item quantities and prices, could I specify an aggregate by order and customer for total price?  Or, supoose I have a number of workflow task data with start and finish, could I average the expected time to finish?

(ok, I admit that could write a JSON service to do this for me, but I would rather have the aggregate in the client side processing, so that I don't need to modify my data access layers)

3. Will Kendo Dataviz support the WebSockets API to get data change events?  If so, how with the API work?

3. A. What is the best practice for telling a DataViz chart that it should go refresh its data?  E.g. Your data is now 5 minutes old, go get a new data.  I would prefer to do this without requiring the page to make a full round-trip to the web server.

3. B. Does DataViz support a straight XML stream (Mime: text/xml) to render a chart?  If so, where can I find examples?

4.  I am given to understand that the Kendo DataViz will only be available in the Ultimate Collection.  For those of us who received the launch-promo license to DataViz and we have Premium Collections, will our licenses and support for Kendo carry over with our subscription renewals?

Thanks in advance for any insights!
j.
Alexander Valchev
Telerik team
 answered on 16 May 2012
3 answers
88 views
I have a paragraph in the editor lie this (looking at html view):

    <p class="some-class">some text</p>

When the user presses 'Enter' to create a new line, the class is repeated:

    <p class="some-class">&nbsp;</p>

I would prefer that a new line create a <p> without the class - how can I make this happen?
Rumen
Telerik team
 answered on 16 May 2012
1 answer
386 views
Hi ,
I have a radgrid with 4 columns, where i have to edit 2nd column highlighted below. What are things i have to achieve this ?
With below code last row 2nd column of grid is in editable mode and entire row is getting highlighted..  what are things i have to do for editing all rows and only 2 column.

Please Suggest   .

   <telerik:RadGrid ID="rdGrdMenu" runat="server" AutoGenerateColumns="false" AllowFilteringByColumn="true"
                Skin="Office2007" GridLines="Both" OnItemDataBound="rdGrdMenu_ItemDataBound" >
                <MasterTableView EditMode="InPlace">
                    <Columns>
                        <telerik:GridBoundColumn HeaderText="Group Level" UniqueName="prdlvl" DataField="prdlvl"
                            Visible="true" ReadOnly="true">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Description" UniqueName="prdlvldsc" DataField="prdlvldsc"
                            Visible="true" >
                        </telerik:GridBoundColumn>

                        <telerik:GridTemplateColumn HeaderText="Budget" UniqueName="budflg" DataField="budflg">
                            <ItemTemplate>
                                <cc1:AFSAt_CodeDropDown ID="drpDownBdgt" runat="server" AtCodeType="000006" Width="100%">
                                </cc1:AFSAt_CodeDropDown>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Status" UniqueName="Status" DataField="codsts">
                            <ItemTemplate>
                                <cc1:AFSAt_CodeDropDown ID="drpDownStatus" runat="server" AtCodeType="000001" Width="100%">
                                </cc1:AFSAt_CodeDropDown>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

Codebehind :
     protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
        //to set the Grid always in edit mode
        foreach (GridDataItem item in rdGrdMenu.MasterTableView.Items)
        {
            item.Edit = true;
        }
        rdGrdMenu.Rebind();
    }

   Regards,
Akki      
Andrey
Telerik team
 answered on 16 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
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
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?