Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
111 views
Good day!

We've noticed some performance issue when trying to do CRUD operations on the scheduler. It seems there's a couple of seconds delay from the end of Page_Load() to the starting point of the CRUD event handlers on postback. Is there any way to improve this?

Thanks.
Peter
Telerik team
 answered on 23 Feb 2010
1 answer
106 views
Hi,
I am just writing to see if it is possible to specify the original position of the spell check dialog. We have spellchecker in an iframe which is causing an unnecessary scrolling when popup is launched(I guess popup is set up to position itself in the center by default)? We are thinking that if we can specify the absolute position, scrolling will not happen.
Thank you for your help!
Kate
Georgi Tunev
Telerik team
 answered on 23 Feb 2010
1 answer
83 views
Hi,

I am having trouble getting radwindow to work in cookieless session. If I enable cookies, it works fine. I am trying to open a page in radwindow. I get the following error

The file '/Sample/(S(zn30jp45etuqgi55evymf5fs))/User/Edit.aspx' doesnot exist.
Where Sample is the application root folder.

I think I need to use the Response.ApplyAppPathModifier  method. But I cant figure out how to use it with the setUrl method.

I would appreciate any help in this matter

thanks




Georgi Tunev
Telerik team
 answered on 23 Feb 2010
1 answer
203 views
Hi,

I am using RadGrid binded to objectdatasource, I am trying to provide a facility to users to export the grid data to csv file.

the aspx file is as follow:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestRadGrid._Default" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"
            DataSourceID="ObjectDataSource1" GridLines="None" AllowCustomPaging="True"
            AllowPaging="True" AllowSorting="True"
            onitemcommand="RadGrid1_ItemCommand" >
        <MasterTableView CommandItemDisplay="Top" DataSourceID="ObjectDataSource1">
            <CommandItemSettings ShowExportToCsvButton="true" />
                 <Columns>
                    <telerik:GridBoundColumn DataField="Name" HeaderText="Name" SortExpression="Name" />
                    <telerik:GridBoundColumn DataField="Age" HeaderText="Age" SortExpression="Age" />
                    <telerik:GridBoundColumn DataField="DOB" HeaderText="DOB" SortExpression="DOB" />
                 </Columns>
        </MasterTableView>
        </telerik:RadGrid>
    </div>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"  EnablePaging="True" SelectCountMethod = "getCount" SortParameterName = "sortExpression"
        SelectMethod="GetData" TypeName="TestRadGrid.DataClass">
        <SelectParameters>
            <asp:Parameter Name="criteria" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    </form>
</body>
</html>

and code behind is as follows:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TestRadGrid
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName == "ExportToCsv")
            {
                RadGrid1.VirtualItemCount = 12;
                RadGrid1.PageSize = 12;
                RadGrid1.ExportSettings.IgnorePaging = true;
                RadGrid1.ExportSettings.OpenInNewWindow = true;
                //RadGrid1.ExportSettings.ExportOnlyData = true;
                RadGrid1.ExportSettings.FileName = "Test";
                RadGrid1.MasterTableView.ExportToCSV();
            }
        }
    }
}


DataClass providing the methods to objectdatasource is:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

namespace TestRadGrid
{
    public class DataClass
    {
        public DataRow[] GetData(string criteria, int maximumRows, int startRowIndex, string sortExpression)
        {
            DataSet ds = new DataSet();
            
            ds.Tables.Add("Table");
            ds.Tables[0].Columns.Add("Id",System.Type.GetType("System.Int32"));
            ds.Tables[0].Columns.Add("Name");
            ds.Tables[0].Columns.Add("Age");
            ds.Tables[0].Columns.Add("DOB");
            DataRow nrow;
            for (int x = 0; x < 12; x++)
            {
                nrow=ds.Tables[0].NewRow();
                nrow["Id"] = x;
                nrow["Name"]="abc" + x.ToString();
                nrow["Age"] = x;
                nrow["DOB"] = DateTime.Now.AddDays(x);
                ds.Tables[0].Rows.Add(nrow);
            }

            int start=startRowIndex;
            int max=startRowIndex+maximumRows;
            DataRow[] rows = ds.Tables[0].Select("Id>=" + start.ToString() + " and Id<=" + max.ToString(), "");


            return rows;
        }

        public int getCount(string criteria)
        {
            return 12;
        }
        
    }
}

This code is not working, please check the above and advice what i am doing wrong here.

Regards,

Syed Fahad Anwar



Princy
Top achievements
Rank 2
 answered on 23 Feb 2010
1 answer
137 views
Hi
I wanted to have atlest 5-6 coulumns under one heading in a grid.I saw the code which was posted in the below link

http://www.telerik.com/community/code-library/aspnet-ajax/grid/individual-filtering-and-sorting-for-sub-columns-in-template-column.aspx

Now the problem what i am facing is ,when the data is very long, the complete column in the grid gets de-align ..I tried even fixing the size still the same result,
Even in the code which was posted in the thread ,when i change the data its the same issue.

Is there any other method other than GridTemplateColumn to implement it.

This is the same code which i got from that thread,i have highlighted the thing i  have changed.

<radG:RadGrid ID="RadGrid1" AllowPaging="True" AutoGenerateColumns="False" AllowFilteringByColumn="True"
                runat="server" Width="200px" Skin="Glassy">
                <MasterTableView Width="100%">
                    <Columns>
                        <custom:MyCustomFilteringColumn datafield1="Country" datafield2="City" headertext="Country/City"
                            uniquename="MyCustomTemplateColumn" HeaderStyle-VerticalAlign="Middle">
                            <headertemplate>
                            <table id="Table1" cellspacing="1" cellpadding="1" width="100%" border="1">
                                <tr>
                                    <td colspan="2" align="center"><b>Address</b></td>
                                </tr>
                                <tr>
                                    <td style="width:50%">
                                        <asp:LinkButton id="btnSortByCountry" Text="Country" Tooltip="Sort by Country" CommandName='Sort'
                                            CommandArgument='Country' runat="server" Width="100%" /></td>
                                    <td style="width:50%">
                                        <asp:LinkButton id="btnSortByCity" Text="City" ToolTip="Sort by City" CommandName='Sort' CommandArgument='City'
                                            runat="server" Width="100%" /></td>
                                </tr>
                            </table>
                        </headertemplate>
                            <itemtemplate>
                            <table id="Table2" cellspacing="1" cellpadding="1" width="100%" border="1">
                                <tr>
                                    <td style="width:50%">RandomValuuesWithOutSpace</td>
                                    <td style="width:50%"><%# Eval("City") %></td>
                                </tr>
                            </table>
                        </itemtemplate>
                        </custom:MyCustomFilteringColumn>
                    </Columns>
                </MasterTableView>
                <PagerStyle Mode="NumericPages" />
            </radG:RadGrid>




Pavlina
Telerik team
 answered on 23 Feb 2010
4 answers
147 views

The pager control on the bottom of the grid shows with the first, prev on one line, pages on a second line, next, last on a third line, page size on a 4th line and item count/numb pages on the 5th line.

I have played with the wrap function, mode, etc of the pager and haven't had any significant changes, none good at least. I can change the text for he pager size and have it reflect so the changes are working. The grid is created in code and added to a placeholder control.

Below is the code above all the columns and the add to place holder, but it is the area where all the formatting is set.

Hopefully you can tell me what when wrong. The problem came up with I upgraded the website, so it had something to do with the changes. I am currently on 2009.3.1314.35

Thanks for your help
Randy Miller

gvReceipts.BorderStyle = BorderStyle.Solid

gvReceipts.BorderWidth = 1

gvReceipts.CellPadding = 3

'gvReceipts.Font.Size = 3

 

 

gvReceipts.ForeColor = Drawing.Color.Black

gvReceipts.GridLines = GridLines.Vertical

gvReceipts.AllowPaging = True

 

 

gvReceipts.AllowSorting = True

 

 

gvReceipts.AutoGenerateColumns = False

 

 

gvReceipts.Height = 415

gvReceipts.Width = 1350 ' Unit.Percentage(100)

 

 

gvReceipts

gvReceipts.FooterStyle.Width = gvReceipts.Width

gvReceipts.FooterStyle.Wrap = False

 

 

'gvReceipts.PagerStyle.Mode = GridPagerMode.Slider

 

 

gvReceipts.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric

'gvReceipts.PagerStyle.

 

 

gvReceipts.Skin = ""

 

 

gvReceipts.PagerStyle.Width = gvReceipts.Width

gvReceipts.MasterTableView.PagerStyle.Width = gvReceipts.Width

gvReceipts.PagerStyle.Wrap = False

 

 

gvReceipts.MasterTableView.PagerStyle.Wrap = gvReceipts.PagerStyle.Wrap

'gvReceipts.Skin = "Default"

 

 

gvReceipts.PageSize = 15

gvReceipts.GroupingEnabled = True

 

 

gvReceipts.ShowGroupPanel = True

 

 

gvReceipts.ClientSettings.AllowDragToGroup = True

 

 

'gvReceipts.HeaderStyle.BackColor = Drawing.ColorTranslator.FromHtml("#711000")

 

 

gvReceipts.HeaderStyle.Font.Bold = True

 

 

'gvReceipts.HeaderStyle.ForeColor = Drawing.ColorTranslator.FromHtml("#DDAA22")

 

 

'gvReceipts.HeaderStyle.BorderColor = Drawing.ColorTranslator.FromHtml("#711000")

 

 

gvReceipts.HeaderStyle.BorderStyle = BorderStyle.None

'gvReceipts.FooterStyle.BackColor = Drawing.ColorTranslator.FromHtml("#CCCCCC")

 

 

'gvReceipts.MasterTableView.DataMember = "Customers"

 

 

''gvReceipts.MasterTableView.PageSize = 15

 

 

gvReceipts.MasterTableView.AlternatingItemStyle.BackColor = Drawing.ColorTranslator.FromHtml("#6699FF")

gvReceipts.MasterTableView.AlternatingItemStyle.Wrap = False

 

 

RefreshData()

gvReceipts.MasterTableView.DataKeyNames = New String() {"rtn_pnref", "clientid"}

Dim colNewColumn As GridBoundColumn

Dim colNewButtonColumn As GridButtonColumn = New GridButtonColumn

colNewButtonColumn.ButtonType = GridButtonColumnType.ImageButton

colNewButtonColumn.HeaderText = "Select"

 

 

colNewButtonColumn.ImageUrl = "~/ClientServices/insurance/images/print.gif"

 

 

colNewButtonColumn.CommandName = "print"

 

 

colNewButtonColumn.AutoPostBackOnFilter = "True"

 

 

colNewButtonColumn.UniqueName = "colSelect"

 

 

colNewButtonColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center

gvReceipts.MasterTableView.Columns.Add(colNewButtonColumn)

Randy
Top achievements
Rank 1
 answered on 23 Feb 2010
1 answer
199 views
Hi Telerik-Support,

It is possible to set the AutoPostBackOnFilter property on each grid column on client side (javascript) without a postback.
The logic to getting the columns/column on javascript isn't a problem. THe problem is more to get the property on client side from each column.

Thanks a lot.

Christian
Tsvetoslav
Telerik team
 answered on 23 Feb 2010
0 answers
79 views

I need help. I don’t know if I'm on the right track or if there is a better way to select a value from a foreign table.
I have 77.000 records in my foreign table and it creates loading problem when I open my EditForm.

I use an ObjectDataSource

<asp:ObjectDataSource ID="DS_All" runat="server" SelectMethod="getAll" 
    TypeName="CRSUsing+CRSData" > 
</asp:ObjectDataSource> 
 


The code behind looks like this

public class loopUpData 
    string Id; 
    string Txt; 
 
    public String id 
    { 
        get { return Id; } 
        set { Id = value; } 
    } 
 
    public String txt 
    { 
        get { return Txt; } 
        set { Txt = value; } 
    } 
public ICollection getSagsbudgetAll() 
    SqlConnection myConnection; 
    ArrayList LookUplist = new ArrayList(); 
 
    myConnection = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["SubjectConnect"].ToString()); 
 
    SqlCommand myCommand = new SqlCommand( 
        @"SELECT   distinct CAST(ID AS VARCHAR) as Id,  
                   (CAST(Id AS VARCHAR) + '  ' + Name) as Txt 
          FROM     s_dim  
          ORDER BY Id", myConnection); 
 
    myConnection.Open(); 
    SqlDataReader reader = myCommand.ExecuteReader(); 
 
    while (reader.Read()) 
    { 
        loopUpData lookUp = new loopUpData(); 
 
        lookUp.id = (string)reader["Id"]; 
        lookUp.txt = (string)reader["Txt"]; 
 
        LookUplist.Add(lookUp); 
    } 
 
    myConnection.Close(); 
    reader.Close(); 
    myCommand.Dispose(); 
 
    if (LookUplist != null && LookUplist.Count > 0) 
        return LookUplist; 
    else return null; 
 
 

In my EditForm I have placed a ComoBox.
<telerik:RadComboBox ID="Box1" AppendDataBoundItems="true" runat="server" DataSourceID="DS_All" 
    Width="300px" DataTextField="Txt" DataValueField="Id" AutoPostBack="True" 
    EnableVirtualScrolling="true" TabIndex="1" EnableLoadOnDemand="true" 
    ShowMoreResultsBox="true"  
    SelectedValue='<%# DataBinder.Eval(Container, "DataItem.Value") %>' 
    ReadOnly='<%# DataItem is GridInsertionObject %>' Skin="Office2007" > 
</telerik:RadComboBox> 
 


Any Ideas on how to do this?
Thanks
Erik


Erik Hansen
Top achievements
Rank 1
 asked on 23 Feb 2010
1 answer
181 views
I have a grid and I'd like to always apply two filter conditions it whenever the user filters the grid.
1) always filter a column based on a bool being false
2) always filter a column based on the value of a session variable

I can get 1) working easy enough with the following code
<telerik:GridCheckBoxColumn DataField="IsOptimumStaff"  
  HeaderText="Active" CurrentFilterFunction="EqualTo" 
  CurrentFilterValue="false" Visible="false" /> 

But I can't get 2) to work I've tried

<telerik:GridBoundColumn DataField="Region.RegionId"  
  HeaderText="Region Id" Visible="false"  
  CurrentFilterFunction="EqualTo"  
  CurrentFilterValue='<%= Session("CurrentRegion") %>' /> 

Is it even possible to do with markup or do I need to write some code behind? If so how do I have my own default filter items while preserving the users filter?

Thanks 
Chris
Tsvetoslav
Telerik team
 answered on 23 Feb 2010
1 answer
101 views
Is there any way through which we can insert page break in the editor?
thanks in advance.
Georgi Tunev
Telerik team
 answered on 23 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?