Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
67 views
Hi
I am using VS 2010 and telerik controls and some how the grids on the page is not displaying the data.
I am using following code.
ASPX
<div style="width: 80%">
                <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1">
                    <div style="float: left; height: 100%; width: 55px; background: #E3EFFF; text-align: center;
                        border-right: 1px solid #6593CF;">
                        <img src="images/tasks.gif" alt="" /></div>
                    <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True"
                        GridLines="None" Width="585px">
                        <MasterTableView AllowMultiColumnSorting="true" />
                        <SortingSettings SortedBackColor="Azure" EnableSkinSortStyles="false" />
                        <HeaderStyle Width="100px" />
                    </telerik:RadGrid>
                </telerik:RadAjaxPanel>
            </div>


protected void PRate_Load(object sender, EventArgs e)
        {
            LoadData();
        }
        protected void LoadData()
        {
            var Person = TypeCreator.TypeGenerator(new[]{
                new {ID=1, PackageName="1 Week", Duration="1 Week",   Rate=29, Price=100},
                new {ID=2, PackageName="1 Month(s)", Duration="1 Week",   Rate=29, Price=100},
                new {ID=3, PackageName="3 Month(s)", Duration="1 Week" , Rate=29, Price=100},
                new {ID=4, PackageName="6 Month(s)", Duration="1 Week",  Rate=29, Price=100},
                new {ID=5, PackageName="9 Month(s)", Duration="1 Week",   Rate=29, Price=100},
                new {ID=6, PackageName="12 Month(s)", Duration="1 Week", Rate=29, Price=100}
            });
            //none of the method is working,
 
            var dt = new System.Data.DataTable();
            dt.Columns.Add(new System.Data.DataColumn("ID", typeof(System.Int16)));
            dt.Columns.Add(new System.Data.DataColumn("PackageName", typeof(System.String)));
            dt.Columns.Add(new System.Data.DataColumn("Duration", typeof(System.String)));
            System.Data.DataRow dr;
            for (int i = 0; i < 100; i++)
            {
                dr = dt.NewRow();
                dr[0] = i;
                dr[1] = "Package" + i;
                dr[2] = i * 10;
                dt.Rows.Add(dr);
            }
 
 
            RadGrid1.DataSource = dt;
            RadGrid1.DataBind();
        }
 
 
   static class TypeCreator
    {
        public static List<T> TypeGenerator<T>(this T[] t)
        {
            return new List<T>(t);
        }
    }
Pavlina
Telerik team
 answered on 26 Jan 2011
1 answer
58 views
Hi,

    i am using rad splitter in my application.i have master page in side that i put splitter control
splitter has two region, menu region and content region. in menu region i am using rad panel bar control for vertical
menu. i am populating the menu items dynamically.after these functionalities done screen is getting too much time to
load.please tell me the solution to improve the performance.

i have attached my sample menu screen shot please refer that 
Dobromir
Telerik team
 answered on 26 Jan 2011
8 answers
271 views
Hi,

I'm trying to put together a line chart showing transactions per day over a period of time, separated out by store.  I noticed that the dates on the X-axis are not correct when compared to the actual data.  The dates on the bottom of the page don't scale, (instead it just uses each date point, so a hash mark can be one day, then jump to a week) and rather than place the datapoint at the right date, it just places it on the next one over.

When I set the DataXColumn setting for some hardcoded series, it worked fine.  So, is there a way to set the DataXColumn for each series and have the chart display the correct dates?  My code is below.

<telerik:RadChart runat="server" ID = "chartTransactions" AutoLayout="true" DataSourceID="datTransactions" DefaultType="Line" DataGroupColumn = "Store" Width="800" >
        <ChartTitle><TextBlock Text = "Transactions - Store"></TextBlock></ChartTitle>      
        <PlotArea>
            <XAxis DataLabelsColumn = "AppRejDate" >
                <Appearance ValueFormat="ShortDate">
                    <LabelAppearance RotationAngle="270">
                    </LabelAppearance>
                </Appearance>
            </XAxis>
        </PlotArea>
    </telerik:RadChart>
<asp:SqlDataSource ID = "datTransactions" runat="server" ConnectionString="<%$ ConnectionStrings:DBString %>" SelectCommand = "Select tblStore_Ref.Description, CAST(DATEADD(Day, DATEDIFF(Day, 0, AppRejDateTime), 0) AS Float) + 2 AS AppRejDate, Count(*) as Transactions From tblTransactionHistory INNER JOIN tblTransactionItems ON tblTransactionHistory.TransactionID = tblTransactionItems.TransactionID INNER JOIN tblStore_Ref ON tblTransactionItems.Store = tblStore_Ref.Store Where Status = 'A' AND AppRejDateTime Between @dateBegin AND @dateEnd Group By DATEADD(Day, DATEDIFF(Day, 0, AppRejDateTime), 0), tblStore_Ref.Description Order By AppRejDate, tblStore_Ref.Description">
        <SelectParameters>
            <asp:ControlParameter ControlID = "dateBegin" Name = "dateBegin" PropertyName="SelectedDate" />
            <asp:ControlParameter ControlID = "dateEnd" Name = "dateEnd" PropertyName="SelectedDate" />
        </SelectParameters>
    </asp:SqlDataSource>

Some sample data:

40513   S-2   1
40518   S-2   2
40519   S-2   1
40549   S-2   4
40553   S-2   3

Thanks.
Michael
Top achievements
Rank 1
 answered on 26 Jan 2011
1 answer
178 views
Is it possible to retrieve the underlying datarow when in any of the RadGrid Events, e.g. ItemDatabound? If this can be done can someone post an example.

From reading various posts it would seem that one would need to access the grid itself to get any data, though it seems rather an overhead to add a hidden column to the grid to have the data bound to it and then retrieve values from the grid. In my case I simply want to retrieve values from the datasource and build a tooltip for each row and I could do without the clutter of numerous hidden grid columns.

Thanks for any help.

Regards
Alan


Pavlina
Telerik team
 answered on 26 Jan 2011
2 answers
198 views
I have been trying to get this to work forever now.. is there something that I am just not seeing.

I am trying to set the max date from the code behind and it's just not cooperating... yet everything else is.

Here's the code behind in the item_created method:
if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
            {               
                GridEditFormItem dataItem = e.Item as GridEditFormItem;
                TableCell cell = dataItem["InspectionDate"];
                RadDatePicker rdp = cell.Controls[0] as RadDatePicker;
                rdp.Calendar.UseColumnHeadersAsSelectors = false;
                rdp.Calendar.UseRowHeadersAsSelectors = false;              
                rdp.MaxDate = DateTime.Now;
           }
 
any ideas would be great... basically it can figure out that the date is too large if you pick past the date, but when the calendar pops up, the dates past today are not grayed out... If I set the max date manually in the markup, it works fine.

please let me know if you need any more info.

Thanks,

Dustin
Marin
Telerik team
 answered on 26 Jan 2011
1 answer
259 views
Hi

I'm working on a Sharepoint 2010 installation, and have had a bit of trouble using the ASyncUpload in a custom Visual WebPart.

I can add files to the RadUploadTemp folder fine, and in fact any folder on the 80 hive, but as far as I can tell there is no way to upload into the 14 hive. Is this correct?

In the past, I have used the standard ASP FileUploader, with an IO Stream to upload directly to the url of my Sharepoint Library, but this does not seem to work with the RAD Async Upload, I just get this error:

'http://local-sharepoint/TestLibrary' is not a valid virtual path.

If I browse to that URL normally it works fine, and works fine with a standard uplader.

Any ideas what's going on here?

Thanks for any help
Steve
Top achievements
Rank 1
 answered on 26 Jan 2011
1 answer
69 views
Hey i am using rad editor. but it is giving me problem in case if i clear the editor. in that case all the button on the page stop working.
only solution i am using is i am not completely clearing the control . i store some blank spaces and blank rows to work and in that case it does not give any problem .
kindly help me is there any thing i can do with this editor. mean do i need to change any property of the editor so that it start working in empty case also.
please reply me soon i m waiting.
Rumen
Telerik team
 answered on 26 Jan 2011
11 answers
167 views
When clicking on a link in my RadGrid I am getting very slow performance.  I've done some performance profiling in VS 2010 and with Fiddler and I've found the following. 

First, there is a large amount of data being sent to the client (about 250kb) for an AJAX enable grid that can be paged, filtered and sorted.  Bandwidth however isn't the problem because this is all running locally in my debug environment. 

Since bandwidth wasn't the issue I decided to profile the code.  When running VS Profiler and looking at the slow operations it tells me that the following functions are mostly responsible for the slow results:

gridItem.onBubbleEvent
system.text.regularexpressions.matchenumerator.movenext
system.text.regularexpressions.regex.match

Where onBubbleEvent is calling the functions beneath it and those function are responsible for 70% of the time it takes to render the page.  Can anybody suggest ideas for improving the performance?  If I had to guess I'd say that given the large amount of data that RadGrid is just having a tough time slogging through it all and rendering html.
Pavlina
Telerik team
 answered on 26 Jan 2011
1 answer
55 views
Hello,

When Grid Export to Excel a Message Box Will apper

Pls Sent a Solution

**File Attached
Daniel
Telerik team
 answered on 26 Jan 2011
4 answers
264 views
Greetings,

I created a custom filter menu that I want to use for one of my radgrid columns. It works fine, but the problem is the menu appears for all columns. I only want this menu to appear for the column "Constituents." Note that I can't use "VaryByDataType" because my columns are all strings. Is it possible to create a custom filter menu for just one column?

ASPX:
<telerik:RadGrid ID="radGridForms" runat="server" AutoGenerateColumns="false"
                GridLines="None" Skin="Windows7" AllowFilteringByColumn="True" AllowPaging="True"
                AllowSorting="True" EnableLinqExpressions="False" Font-Bold="False" Font-Italic="False"
                 Font-Overline="False" Font-Size="Small" Font-Strikeout="False" Font-Underline="False" 
                 OnItemDataBound="radGridForms_ItemDataBound" OnNeedDataSource="radGridForms_NeedDataSource">
                <ClientSettings Selecting-AllowRowSelect="false" EnableRowHoverStyle="true">
                    <ClientEvents />
                </ClientSettings>
                <PagerStyle Position="Top" />
                <MasterTableView PageSize="10" AllowSorting="true" EnableNoRecordsTemplate="true" ShowHeadersWhenNoRecords="true"
                    Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Size="Small"
                    Font-Strikeout="False" Font-Underline="False" DataKeyNames="FormID" >
                    <RowIndicatorColumn>
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn>
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridBoundColumn DataField="FormID" UniqueName="FormID" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridHyperLinkColumn DataNavigateUrlFields="PDFLink"
                            DataNavigateUrlFormatString="http://webcms/{0}" UniqueName="PDFLink"
                            AllowFiltering="false" HeaderText="Download" ItemStyle-HorizontalAlign="Center">
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </telerik:GridHyperLinkColumn>
                        <telerik:GridBoundColumn DataField="Description" HeaderText="Description" UniqueName="Description"
                            CurrentFilterFunction="Contains" AutoPostBackOnFilter="True" ItemStyle-Font-Size="XX-Small" 
                            AllowSorting="true">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="State" HeaderText="State" UniqueName="State"
                            CurrentFilterFunction="Contains" AutoPostBackOnFilter="True" ItemStyle-Font-Size="XX-Small" 
                            AllowSorting="true">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Constituents" HeaderText="Constituents" UniqueName="Constituents"
                            CurrentFilterFunction="Contains" AutoPostBackOnFilter="True" ItemStyle-Font-Size="XX-Small" 
                            AllowSorting="true">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Keywords" HeaderText="Keywords" UniqueName="Keywords"
                            CurrentFilterFunction="Contains" AutoPostBackOnFilter="True" ItemStyle-Font-Size="XX-Small" 
                            AllowSorting="true">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Version" AllowFiltering="false" ItemStyle-Font-Size="XX-Small" 
                            HeaderText="Ver" UniqueName="Version" >
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Type" AllowFiltering="false" ItemStyle-Font-Size="XX-Small" 
                            HeaderText="Type" UniqueName="Type" AllowSorting="true">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Secure" UniqueName="Secure" Visible="false">
                        </telerik:GridBoundColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>


C# CodeBehind:
protected void Page_Init(object senderEventArgs e)
        {
            radGridForms.FilterMenu.Items.Clear();
            GridFilterMenu filterMenu = radGridForms.FilterMenu;
            RadMenuItem onlyEmployerMenuItem = new RadMenuItem();
            RadMenuItem onlyProducerMenuItem = new RadMenuItem();
            RadMenuItem onlyIndividualsMenuItem = new RadMenuItem();
            
            radGridForms.FilterMenu.Items.Add(onlyEmployerMenuItem);
            radGridForms.FilterMenu.Items.Add(onlyProducerMenuItem);
            radGridForms.FilterMenu.Items.Add(onlyIndividualsMenuItem);
            
            onlyEmployerMenuItem.Text = "Show Only Employers";
            onlyEmployerMenuItem.Value = "Employers";
            onlyProducerMenuItem.Text = "Show Only Producers";
            onlyProducerMenuItem.Value = "Producers";
            onlyIndividualsMenuItem.Text = "Show Only Individuals";
            onlyIndividualsMenuItem.Value = "Individuals";
            filterMenu.ItemClick += new RadMenuEventHandler(filterMenu_ItemClick);

        }

        protected void filterMenu_ItemClick(object senderRadMenuEventArgs e)
        {
            if (e.Item.Value.ToString() == "Employers")
            {
                radGridForms.MasterTableView.FilterExpression = "([Constituents] = 'Employers') ";
                GridColumn column = radGridForms.MasterTableView.GetColumnSafe("Constituents");
                column.CurrentFilterFunction = GridKnownFunction.Contains;
                radGridForms.DataSource = null;
                radGridForms.Rebind();
            }
            else if(e.Item.Value.ToString() == "Producers")
            {
                radGridForms.MasterTableView.FilterExpression = "([Constituents] = 'Producers') ";
                GridColumn column = radGridForms.MasterTableView.GetColumnSafe("Constituents");
                column.CurrentFilterFunction = GridKnownFunction.Contains;
                radGridForms.DataSource = null;
                radGridForms.Rebind();
            }
            else if (e.Item.Value.ToString() == "Individuals")
            {
                radGridForms.MasterTableView.FilterExpression = "([Constituents] = 'Individuals') ";
                GridColumn column = radGridForms.MasterTableView.GetColumnSafe("Constituents");
                column.CurrentFilterFunction = GridKnownFunction.Contains;
                radGridForms.DataSource = null;
                radGridForms.Rebind();
            }
        }

Jon
Top achievements
Rank 1
 answered on 26 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?