Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
95 views
Hi! When user clicks on Add new row in detailsTables i want a parent data key name to pass to new page... on client side
but i have CommandItemTemplate on detailsTables, therefore kindly tell how could i get parent datakeyvalue on ShowInsertForm function.
<CommandItemTemplate>
                    <div class="lnkStyle">
                        <a href="#" onclick="return ShowInsertForm();" style="text-decoration: none;">
                            <img id="imgAdd" src="../Images/icon_add.png" style="border-width: 0px;" />
                            Add new record </a>
                    </div>
                </CommandItemTemplate>                
Winston Yong
Top achievements
Rank 1
 answered on 27 Sep 2010
1 answer
113 views
Hi,

I am having a radgrid with  a radnumeric column to display amount. 
In Radnumeric column i am displaying total in footer of that column. 

The problem is i need to store that total amount to a variable as i need that amount for some calculation.

Please help me in this issue. 

Need urgent help

Regards,
Prathap Narravula   
Princy
Top achievements
Rank 2
 answered on 27 Sep 2010
2 answers
115 views
Good day!
I have got suchan html maket of site - http://aptekaural.ru/docs/fornet2.html
All the content is in the left column, the right column contains only menu. You can hide or show the right column on button click. When the right column hide, the content of the left column fills all the page.
When I put a RadGrid into the left column, it looks good in all browswes, but in GoogleChrome & Safari it looks awfull - grid has narrow footer & header, grid's width takes both left & right column's width and nothing helps. button click doesn't help too. YOu can see the printscrins attached to the theme.

I'm speaking about cush a rad grid:

<telerik:RadGrid  ID="grClients" runat="server" GridLines="None" AllowPaging="True"
          AllowAutomaticInserts="True" AllowAutomaticUpdates="True"  AllowFilteringByColumn="True"
          AllowSorting="True"  PageSize="50"   Skin="Windows7"
        OnNeedDataSource="RadGrid1_NeedDataSource" AutoGenerateColumns="False"
        ShowGroupPanel="True" Width="100%" Height="100%" GroupPanel-Width="100%"
       >
        <MasterTableView EditMode="PopUp" DataKeyNames="Id">
            <Columns>
                <telerik:GridBoundColumn ReadOnly="True" DataField="Name" HeaderText="Название" SortExpression="Name" UniqueName="Name"/>
                <telerik:GridBoundColumn ReadOnly="True" DataField="Login" HeaderText="Логин"
                    HeaderStyle-Width="100" FilterControlWidth="50" SortExpression="Login"
                    UniqueName="Login">
<HeaderStyle Width="100px"></HeaderStyle>
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn ReadOnly="True" DataField="CityRegionName" HeaderText="Регион" SortExpression="CityRegionName" UniqueName="CityRegionName"/>
                <telerik:GridBoundColumn ReadOnly="True" DataField="CityName"
                    HeaderText="Город" SortExpression="CityName" UniqueName="CityName"
                    HeaderStyle-Width="150" FilterControlWidth="100">
<HeaderStyle Width="150px"></HeaderStyle>
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn ReadOnly="True" DataField="Cell" HeaderText="Телефон" SortExpression="Cell" UniqueName="Cell"/>
                <telerik:GridDateTimeColumn DataField="CreatedOn.Date"
                    HeaderText="Дата регистрации"
                    ReadOnly="True" SortExpression="CreatedOn.Date"
                    UniqueName="CreatedOn.Date" DataFormatString="{0:d}" DataType="System.DateTime" HeaderStyle-Width="80">
<HeaderStyle Width="80px"></HeaderStyle>
                </telerik:GridDateTimeColumn>
                <telerik:GridCheckBoxColumn DataField="UserIsApproved" HeaderText="Активация"
                    UniqueName="UserIsApproved" ReadOnly="True" DataType="System.Boolean" HeaderStyle-Width="50">
<HeaderStyle Width="50px"></HeaderStyle>
                </telerik:GridCheckBoxColumn>
                <telerik:GridCheckBoxColumn DataField="HasAccount" HeaderText="Есть аккаунт"
                    UniqueName="HasAccount" ReadOnly="True" DataType="System.Boolean" HeaderStyle-Width="50" >
<HeaderStyle Width="50px"></HeaderStyle>
                </telerik:GridCheckBoxColumn>

            </Columns>
        </MasterTableView>       
         <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True"
            AllowDragToGroup="True">
            <Selecting AllowRowSelect="true" />
            <ClientEvents OnRowContextMenu="RowContextMenu"></ClientEvents>
            <Resizing EnableRealTimeResize="false" />
        </ClientSettings>
        <PagerStyle Mode="NextPrevAndNumeric" />
    </telerik:RadGrid>


Any ideas what to do?
lina fetisova
Top achievements
Rank 1
 answered on 27 Sep 2010
5 answers
138 views
Hello,

I'm using two listboxes inside of a tooltip.  The list boxes are configured for single transfer with drag and drop enabled. I am having a problem where I am unable to transfer a single item between the listboxes. Any ideas why this might be happening? I'm using VS2010 and the .NET 4 version of the latest build of Telerik.
Customer.aspx:
  
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="customers.aspx.cs" Inherits="customers" %>
<%@ Register Src="assignusers.ascx" TagName="ProductDetails" TagPrefix="uc1" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" runat="server" Skin="Windows7" />
          
        <telerik:RadAjaxManager ID="AjaxManager1" runat="server" EnablePageHeadUpdate="false">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1"/>
                        <telerik:AjaxUpdatedControl ControlID="Literal1" />
                        <telerik:AjaxUpdatedControl ControlID="RadToolTipManager1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
  
        <telerik:RadToolTipManager ID="RadToolTipManager1" OffsetY="-1" HideEvent="ManualClose"
            Width="620" Height="230" runat="server" EnableShadow="true" OnAjaxUpdate="OnAjaxUpdate"
            RelativeTo="Element" Position="MiddleRight" Modal="true">
        </telerik:RadToolTipManager>
  
        <asp:Literal ID="Literal1" runat="server" Text="" />
        <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" DataSourceID="EntityDataSource1"
             AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true" AllowPaging="true" PageSize="10"
             EnableLinqExpressions="false" OnItemCommand="RadGrid1_ItemCommand" OnItemDataBound="RadGrid1_ItemDataBound">
             <MasterTableView DataKeyNames="id" CommandItemDisplay="Top" EditMode="PopUp">
                 <EditFormSettings CaptionFormatString="Add/Edit Customers" PopUpSettings-Modal="true"
                     EditFormType="WebUserControl" UserControlName="editcustomer.ascx" PopUpSettings-Width="700px">
                 </EditFormSettings>
                 <Columns>
                    <telerik:GridButtonColumn ButtonType="LinkButton" Text="edit" CommandName="Edit" />
                    <telerik:GridButtonColumn ButtonType="LinkButton" Text="delete" CommandName="Delete" />
                    <telerik:GridBoundColumn DataField="name" HeaderText="Name" />
                    <telerik:GridTemplateColumn UniqueName="AssignUsers">
                        <ItemTemplate>
                            <asp:HyperLink ID="targetControl" runat="server" NavigateUrl="#" Text="Assign Users" />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
             </MasterTableView>
        </telerik:RadGrid>
    </div>
    <asp:EntityDataSource ID="EntityDataSource1" runat="server" 
        ConnectionString="name=EntityFrameworkTestEntities" 
        DefaultContainerName="EntityFrameworkTestEntities" EnableDelete="True" 
        EnableFlattening="False" EnableInsert="True" EnableUpdate="True" 
        EntitySetName="Customers" Include="Users" OnDeleted="EntityDataSource1_Deleted"
        OnInserting="EntityDataSource1_Inserting" OnUpdating="EntityDataSource1_Updating"
        OnInserted="EntityDataSource1_Inserted" OnUpdated="EntityDataSource1_Updated"
        ViewStateMode="Enabled">
    </asp:EntityDataSource>
    </form>
</body>
</html>
  
assignusers.ascx:
  
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="assignusers.ascx.cs" Inherits="assignusers" %>
<%@ Import Namespace="Telerik.Web.UI" %>
<div>
    <table>
        <tr>
            <td>Users <b>NOT</b> Assigned To This Customer</td>
            <td>Users Assigned To This Customer</td>
        </tr>
        <tr>
            <td>
                <telerik:RadListBox ID="RadListBox1" runat="server" Width="300px" Height="200px" AutoPostBack="false"
                    SelectionMode="Single" AllowTransfer="true" TransferToID="RadListBox2" AutoPostBackOnTransfer="true"
                    EnableDragAndDrop="true" AllowReorder="false">
                </telerik:RadListBox>
            </td>
            <td>
                <telerik:RadListBox ID="RadListBox2" runat="server" Width="300px" Height="200px" AutoPostBack="false"
                    SelectionMode="Single" AllowReorder="false" EnableDragAndDrop="true" AutoPostBackOnTransfer="true" 
                    AllowTransfer="true" TransferToID="RadListBox1"
                    OnDeleting="RadListBox2_Deleting" OnInserting="RadListBox2_Inserting">
                </telerik:RadListBox>
            </td>
        </tr>
    </table>
</div>
  
assignusers.ascx.cs:
  
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections.Specialized;
using Telerik.Web.UI;
  
public partial class assignusers : System.Web.UI.UserControl
{
    public int Id
    {
        get { return Convert.ToInt32(ViewState["id"]); }
        set { ViewState["id"] = value.ToString(); }
    }
  
  
    protected void Page_Load(object sender, EventArgs e)
    {
        RadListBox1.Items.Clear();
        RadListBox2.Items.Clear();
        using (var context = new EntityFrameworkTestModel.EntityFrameworkTestEntities())
        {
            if (RadListBox2.DataSource == null)
            {
  
                var customer = context.Customers.First(p => p.id == Id);
                RadListBox2.DataSource = customer.Users.ToList();
                RadListBox2.DataKeyField = "id";
                RadListBox2.DataTextField = "name";
                RadListBox2.DataValueField = "id";
                RadListBox2.DataBind();
            }
  
            if (RadListBox1.Items.Count == 0)
            {
                var users = from u in context.Users
                            orderby u.name
                            select u;
                foreach (var user in users)
                {
                    if (RadListBox2.FindItemByValue(user.id.ToString()) == null)
                    {
                        RadListBoxItem _item = new RadListBoxItem(user.name, user.id.ToString());
                        RadListBox1.Items.Add(_item);
                    }
                }
            }
        }
    }
  
    protected void RadListBox2_Deleting(object sender, RadListBoxDeletingEventArgs e)
    {
        using (var context = new EntityFrameworkTestModel.EntityFrameworkTestEntities())
        {
            var customer = context.Customers.First(p => p.id == Id);
            foreach (RadListBoxItem item in e.Items)
            {
                int _itemid = Convert.ToInt32(item.Value);
                var user = context.Users.First(u => u.id == _itemid);
                customer.Users.Remove(user);
            }
            context.SaveChanges();
        }
    }
  
    protected void RadListBox2_Inserting(object sender, RadListBoxInsertingEventArgs e)
    {
        using (var context = new EntityFrameworkTestModel.EntityFrameworkTestEntities())
        {
            var customer = context.Customers.First(p => p.id == Id);
            foreach (RadListBoxItem item in e.Items)
            {
                int _itemid = Convert.ToInt32(item.Value);
                var user = context.Users.First(u => u.id == _itemid);
                customer.Users.Add(user);
            }
            context.SaveChanges();
        }
    }
}

Thanks in advance.
Larry
Larry
Top achievements
Rank 1
 answered on 26 Sep 2010
1 answer
126 views
I have a grid that has one template column that i format each rows data to a specific style. On this grid there are links that you can click for each row that pops up a rad window to show the details of the item clicked. When i click the link the window opens an stays where I clicked on the row but the grid itself jumps back to the top so I have to scroll to find the open window.  Is that usual, I am using Q2 2010 controls . I have my maintain scroll position on postback but  set to true so when the grid does a post back like paging it maintain the position but when i call the rad window it jumps back to the top each time.  for a example of what is happening you can view the link below I have a test site setup.

 setupremoved     
click on a title and you will see that the window opens near the click but the grid jumps back to the top  if you need code i will post it thanks in advance

Sincerely Dwayne
Dwayne
Top achievements
Rank 1
 answered on 26 Sep 2010
1 answer
88 views
Hello,

I am new to Telerik controls and here is my first issue.

There is a WSI service that provides a JPG image as byte[] array. The image can be easily saved to the file as following:

FileStream fs = new FileStream(fullPath, FileMode.Create);
fs.Write(picture_aray, 0, picture.Length);
fs.Flush();
fs.Close();

Now, i am trying to use RadBinaryImage control and its DataValue property:

EmployeePhoto.DataValue = picture_array;

The result is rendered as an empty image.

<img style="height: 340px; width: 344px;" src="../Telerik.Web.UI.WebResource.axd?imgid=11b68653b19b407494f577727fdb969d&amp;type=rbi" id="ctl00_m_g_f2e35c4b_5688_4365_852b_d3bfe094880d_ctl00_EmployeePhoto">

As you see, dimensions of image are correctly set, so there is no problem with byte[] data. Instead there is something wrong with handlers.

I edited web.config file for sharepoint to include
<add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
in System.webServer - > Handlers.

But this did not help. Any ideas?

Ross
Top achievements
Rank 1
 answered on 25 Sep 2010
1 answer
68 views
Hello,

I am attempting to write code to sort the grid using an IEnumerable object as the data source.

Basically, I just get the column that the user is sorting by and perform an ORDER BY on my IEnumerable object and then rebind it to the grid.

The issue I am running into is that when I do it this way, the arrows in the column header that denote the sort direction (ascending, descending) do not appear.

Is there a way in which I can manually get the arrows to appear?

Thanks,
Dave
Iana Tsolova
Telerik team
 answered on 25 Sep 2010
1 answer
53 views
Hello,

I am using a Radgrid to display some data that I am returning via Linq.  The procedure running the Linq statement returns the data as an IList<ActivityAssociation> (where ActivityAssociation is the type).  This IList contains data from several different tables.

I want to allow the user to sort the data on the radgrid.  I have no problem displaying the data, but if I use the IList as the DataSource, I cannot sort the data without errors being thrown.

If I traverse the IList, the properties I get are things such as ActivityAssociation.ActivityId, ActivityAssociation.PERSON.PERSON_NAME, etc.  I can set the DataField to "ActivityId" as well as "PERSON.PERSON_NAME" and display the data fine, but if I set the Sort Expression to "PERSON.PERSON_NAME", it claims that it cannot find the column whenever I try to sort and rebind the table.  I even re-generate the IList prior to rebinding.

I was able to get around this by looping through the IList and creating a DataTable to use as the grid's datasource, but this is not the optimal solution as the amount of data returned could be large.

Does anybody have any suggestions?

Thanks,
Dave


Iana Tsolova
Telerik team
 answered on 25 Sep 2010
5 answers
345 views
I am trying to extend the the rad async uploader to do something similar to the demo but i am not having any luck with getting the custom configuartions  before inseting the image. The example i was trying to follow was this
http://demos.telerik.com/aspnet-ajax/upload/examples/async/imageuploader/defaultvb.aspx

Dwayne
Top achievements
Rank 1
 answered on 25 Sep 2010
0 answers
40 views
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?