Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
73 views
I  have "CHART_COLUMN" in grid and need to able to export grid  to .pdf as image.Problem is a chart.
 I saved chart as .jpeg. Could you check my code. I appreciate any help or resources.

    RadChart chart = (RadChart)item["CHART_COLUMN"].FindControl("RadChart1");
                SetChart(chart, item);
                MemoryStream imageStream = new MemoryStream();
                chart.Save(imageStream, ImageFormat.Jpeg);
                Byte[] imageContent = new Byte[imageStream.Length];
                imageStream.Position = 0;
                Response.ContentType = "image/gif";
                imageStream.Read(imageContent, 0, (Int32)imageStream.Length);
                imageStream.Close();


                RadBinaryImage rbi = (RadBinaryImage)item["chartimage"].FindControl("RadBinaryImage1");
                if (rbi != null)
                {
                    rbi.DataValue = (Byte[])imageContent;
                   // rbi.DataBind();


                }

Jelena Nahaja
Top achievements
Rank 1
 answered on 04 Mar 2011
2 answers
180 views
Hi:
I am using liquid css with my RadDatePicker, and it works fine in Casini (VS Dev), but not in IIS7.  The Css is as follows:
.field
{
    float: left;
    padding: 5px 30px 5px 0px;
    height: 35px;
}
.field h5
{
    font-size: .9em;
    font-weight: bold;
    padding: 0;
    margin: 0;
}
And the following code demonstrates the issue:
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<script runat="server">
</script>
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
            <Scripts>
                <asp:ScriptReference Path="Scripts/jquery-1.4.1.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <telerik:RadAjaxPanel ID="orderSelectionRadAjaxPanel" runat="server" CssClass="ScreenWidth">
        <div style="width: 100%; margin: 0px; padding-top: 20px;">
            <div class="field">
                <h5>Top 200 Orders:</h5>
                RadComboBox
            </div>
            <div class="field">
                <h5>Start Date:</h5>
                <telerik:RadDatePicker ID="startRadDatePicker" runat="server"
                    AutoPostBack="True" >
                    <Calendar ID="Calendar1" runat="server" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>
                    <DateInput ID="DateInput1" runat="server" DisplayDateFormat="M/d/yyyy" DateFormat="M/d/yyyy" AutoPostBack="True"></DateInput>
                    <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                </telerik:RadDatePicker>
                <asp:RequiredFieldValidator ID="startValidator1" runat="server"
                    ControlToValidate="startRadDatePicker" ValidationGroup="selectionValidationGroup"
                    ErrorMessage="'Start Date' is required" Text="*"
                    />
            </div>
            <div class="field">
                <h5>End Date:</h5>
                <telerik:RadDatePicker ID="endRadDatePicker" runat="server"
                    AutoPostBack="True" >
                    <Calendar ID="Calendar2" runat="server" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>
                    <DateInput ID="DateInput2" runat="server" DisplayDateFormat="M/d/yyyy" DateFormat="M/d/yyyy" AutoPostBack="True"></DateInput>
                    <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                </telerik:RadDatePicker>
                <asp:RequiredFieldValidator ID="endValidator1" runat="server"
                    ControlToValidate="endRadDatePicker" ValidationGroup="selectionValidationGroup"
                    ErrorMessage="'End Date' is required" Text="*"
                    />
            </div>
            <div class="field">
                <h5>Customers:</h5>
                RadComboBox
            </div>
        </div>
       </telerik:RadAjaxPanel>
    </form>
</body>
</html>

Thanks for you help.
Phil
Phil H.
Top achievements
Rank 2
 answered on 04 Mar 2011
2 answers
104 views
I read the message that you folks are working with short staff the next couple of days...This can wait until next week.  The page is not in production yet.

I am having a problem with the combo box dropdown and the menu (both Telerik's).  The "text only" portion of the menus is showing through the dropdown of the combo box.  I have tried ZIndex settings of 750 on the combo box and 500 on the menu to no avail.

I have attached a screen capture of the problem.  Any suggestions as to how to resolve this would be appreciated.

Thanks in advance and have a great holiday week-end over there.  We're all having to work today.

Lynn
Lynn
Top achievements
Rank 2
 answered on 04 Mar 2011
1 answer
88 views
Hi, how can I bind a RadGrid when I need to include details from more than one entity?

I have the following code that runs, definitely brings back data but does not show anything in my grid (with AutoGenerateColumns set to "true"):

protected void MyGrid_OnNeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    using (var context = new MyContainer())
    {
        var d = from data in context.ParentEntity.Include("ChildEntities"
                select new
                {
                    data.ParentProperty, 
                    data.ChildEntity.FirstOrDefault().ChildProperty
                };
  
        this.MyGrid.DataSource = d.ToList();
    }
}

I don't mind admitting my LINQ to Entities knowledge is "ongoing" but you can see what I am trying to do: for every ParentEntity, get me their properties and for every ChildEntity under that, get me their properties as well. I want the grid to display those.

Because the ChildEntity may not necessarilly immediately have a ParentEntity, I can't do a master / detail view with two grids.

Richard
Pavlina
Telerik team
 answered on 04 Mar 2011
2 answers
217 views
Hi is it possible using RadComboBox?

When the user clicks on the RadComboBox
it has to show  5 Labels and one Text box below the 5 labels and button below the textbox?


Regards
Bhuvan
Bhuvan
Top achievements
Rank 1
 answered on 04 Mar 2011
1 answer
299 views

Hi

we have page on which i have radio button list with Autopost = true when page load for the first time it works fine
but when i move from Page 1 to Page 2 And come back to page 1 with some query string when click on radio button list it does not post back

Plz See Code below

 <div id="divshippmethod" class="PageSection full ShippingInformation" runat="server">
        <h1>
            Shipping Method</h1>
        <div class="content">
            <asp:RadioButtonList CellSpacing="0" CellPadding="0" ID="rbtnShippingMethod" RepeatDirection="Horizontal"
                AutoPostBack="true" runat="server">
                <asp:ListItem Text="&nbsp;&nbsp;Shipping Information" Value="0" Selected="True"></asp:ListItem>
                <asp:ListItem Text="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Mail List Upload"
                    Value="1"></asp:ListItem>
            </asp:RadioButtonList>
        </div>

Rajax setting are below
 <telerik:AjaxSetting AjaxControlID="rbtnShippingMethod">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rbtnShippingMethod" LoadingPanelID="RadAjaxLoadingPanel" />
                        <telerik:AjaxUpdatedControl ControlID="pnlShipping" />
                        <telerik:AjaxUpdatedControl ControlID="pnlMailListUpload" />
                    </UpdatedControls>
                </telerik:AjaxSetting>

Protected Sub rbtnShippingMethod_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rbtnShippingMethod.SelectedIndexChanged
        If rbtnShippingMethod.SelectedValue = 1 Then
            pnlShipping.Visible = False
            pnlMailListUpload.Visible = True
        Else
            pnlShipping.Visible = True
            pnlMailListUpload.Visible = False
        End If
    End Sub
first time when pnlMailListUpload. is true, it has a button which Response.Redirects to another page on which i do some activity and come back to this page again.

now if i select any item from the radiobuttonlist then rbtnShippingMethod_SelectedIndexChanged is not firing , on doing inspectElement from FF we found that the required postback JS (__dopostbakc) is not attached with the onclick event of the radio button.

plz help.

Kiara
Top achievements
Rank 1
 answered on 04 Mar 2011
1 answer
87 views
Hi

Please see the images of the database table and the mockup of graph I want. Is this possible? If so any idea how to do this?

Thanks
Ves
Telerik team
 answered on 04 Mar 2011
1 answer
451 views

I am using GridImageColumn for displaying an icon if the value in a table column (HasRead) which is bound to the RadGrid Control is false.

Here is the aspx code..

<Telerik:RadGrid ID="TelerikThread" Width="97%" AllowSorting="True" PageSize="15" 
    OnItemDataBound="TelerikThread_ItemDataBound" AllowPaging="True" 
    AllowMultiRowSelection="True" runat="server" Gridlines="None"
<MasterTableView Width="100%" Summary="RadGrid table"   AutoGenerateColumns="false"
<PagerStyle Mode="NextPrevAndNumeric" /> 
<Columns
<Telerik:GridImageColumn UniqueName="GridImageColumn" SortExpression="HasRead" 
    HeaderText="Unread" DataImageUrlFields="HasRead"
</Telerik:GridImageColumn>

Below is the code behind

      protected void TelerikThread_ItemDataBound(object sender, GridItemEventArgs e)
      {
          if (e.Item is GridDataItem)
          {
              GridDataItem item = (GridDataItem)e.Item;
              TableCell flag = (TableCell)item["HasRead"];
              if (flag.Text == "false")
              {
                  System.Web.UI.WebControls.Image img = (System.Web.UI.WebControls.Image)item["GridImageColumn"].Controls[0];
                  img.ImageUrl = "./web/Themes/default/images/post_status_new_ln.gif";//set image url
              }
              else
              {
                  TableCell cell = (TableCell)item["GridImageColumn"];
                  cell.Text = " ";//clears image column
              }
          }
}

I'm getting exception in the line GridDataItem item = (GridDataItem)e.Item;
"Cannot cast e.item to GridDataItem"

Please help me resolving this..

Thanks in advance.
Princy
Top achievements
Rank 2
 answered on 04 Mar 2011
1 answer
119 views
Hello Team,

I have stored file/folder structure on Network Server(on another server than where application Deployed). If i used local machine's folder for storing file/folder structure, its working fine. If i used network PC for storing files it gives File Permission Error while deleting and rename.
Can you please suggest what to do?

Thanks,
Josh

Dobromir
Telerik team
 answered on 04 Mar 2011
1 answer
49 views

Hi,

I have a Self Referencing Hierarchy grid in which i have made rows editable on double click client event. Required grid properties for disabling multiple rows edit at the same time have been set as follows-

 

 

 

AllowMultiRowSelection="false" AllowMultiRowEdit="false"

 

 

 

 

Still I am able to select and Edit multiple rows at a time.
Client Settings are as follows-

<ClientSettings  AllowExpandCollapse="true">
                <ClientEvents OnRowDblClick="RowdblClick"/>
                <Selecting AllowRowSelect="True"/>
                </ClientSettings>



Javascript used-

<script language="javascript" type="text/javascript">
        function RowdblClick(sender, eventArgs)
        {
          RowEdit(sender, eventArgs);
        }
        function RowEdit(sender, eventArgs)
        {
            //debugger;
            var editedRow = eventArgs.get_item();
            editedRow.id= eventArgs.get_id();
            $find("<%= RadGrid1.MasterTableView.ClientID %>").editItem(editedRow);
        }   
      
        </script>
Vasil
Telerik team
 answered on 04 Mar 2011
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?