Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
118 views
Hi,

When I specify a mask, is there a setting to make sure the user enters it entirely? For example, for phone numbers: (###) ###-####, I would want the user to enter all digits and not partial. I would want (602) 555-1212 instead of (602) 5.

Thx
G
Martin
Telerik team
 answered on 25 Aug 2011
3 answers
96 views
Hi
I am using RadControl ajax Q1 2011 net 4

I am having issues trying to get the correct rad page to display on page load.
I have 5 tabs on a strip but when the page loads I want it to load page 2 by default.
Instead when I run the app it displays the correct tab highlighted on the tab strip but the wrong multi page index 0 is being shown when I have explicitly told both TabStrip and multi page that the selected index should be 1. I have also told it the same information in the page_load event.

If I set the selected indexes to 0 then it works as it should do.

I have tried all variations of setting selecting SelectedIndex in the tab strip, multi page and the page views and it just wont work.

As a temporary fix I have done the following.

OnPage load start a timer,
when the timer fires a call an ajax callback to set the selected index server side
ajax returns and the correct tab is shown.

I have a similar issue on another page where I have 2 tab strips on the same page but both these should be displaying index position 0.
The first tab is fine and draws the correct radpage but the second tab does not draw a page at all until I click a different tab and then click back?

Any help on this greatly appreciated.


Dimitar Terziev
Telerik team
 answered on 25 Aug 2011
2 answers
150 views
Hi,

I'm trying to update my grid in a dynamically load usercontrol( grid is not dynamically added) but the UpdateCommand event is not firing. The usercontrol works fine when I put it directly on my page. But when I load it in the codebehind he fires the need_datasource and than ofcourse the updatecommand is lost. Is it a problem with viewstate? Paging and itemcommand works fine.

Thanks
Bart Reekmans
Top achievements
Rank 1
 answered on 25 Aug 2011
1 answer
677 views
I'm using Jason Maronge's code found here: http://www.telerik.com/community/forums/aspnet-ajax/grid/adding-multiple-header-rows-at-runtime-in-radgrid.aspx to add an additional header row to my grid. Here's my code:

void rgItemSummary_PreRender(object sender, EventArgs e)
    {
        //get the current header
        GridItem[] header = rgItemSummary.MasterTableView.GetItems(GridItemType.Header);
  
        //get the current THead element
        GridTHead head = ((GridTHead)header[0].Parent.Controls[0].Parent);
  
        //Get the GridHeaderItem from the THead
        GridHeaderItem currentHeaderItem = (GridHeaderItem)head.Controls[0];
  
        //Clear all GridHeaderItems
        head.Controls.Clear();
  
        //create a new GridHeaderItem which will be the new row
        GridHeaderItem newHeaderItem = new GridHeaderItem(rgItemSummary.MasterTableView, 0, 0);
  
        //Active column header
        GridTableHeaderCell itemInfoCell = new GridTableHeaderCell()
        {
            Text = "Item Info",
            ColumnSpan = 3,
            HorizontalAlign = HorizontalAlign.Center
        };
  
        //Period Data Header
        GridTableHeaderCell periodCell = new GridTableHeaderCell()
        {
            Text = "Period Data",
            ColumnSpan = 3,
            HorizontalAlign = HorizontalAlign.Center
        };
  
        //Current Available Header
        GridTableHeaderCell currentAvailableCell = new GridTableHeaderCell()
        {
            Text = "Current Available",
            ColumnSpan = 3,
            HorizontalAlign = HorizontalAlign.Center
        };
  
        newHeaderItem.Cells.Add(itemInfoCell);
        newHeaderItem.Cells.Add(periodCell);
        newHeaderItem.Cells.Add(currentAvailableCell);
  
        //Add back the GridHeaderItems in the order you want them to appear
        head.Controls.Add(newHeaderItem);
        head.Controls.Add(currentHeaderItem);
    }
 
Here's the problem: Only the "Current Available" cell is showing up. Any ideas what I'm doing wrong here?

EDIT: Assuming that the grid was only accepting the last cell that I added, I commented out newHeaderItem.Cells.Add(currentAvailableCell);. Oddly enough, that removed the Current Available but the other cells still were not added. When I step through the code, I can see that after newHeaderItem.Cells.Add(currentAvailableCell); is executed, the newHeaderItem object contains three controls. Why is only one being rendered?
Pavlina
Telerik team
 answered on 25 Aug 2011
2 answers
77 views
hello

any control for asp.net or asp.net ajax

plz tell me
Dharmesh
Top achievements
Rank 1
 answered on 25 Aug 2011
6 answers
259 views
OK,
I have the following setup on my Page.

Default.aspx contains a UserControl (ProjectGrid.asmx).

ProjectGrid.asmx contains a Grid (with an edit column). the Grid is set to EditForms with a CustomUserControl form (ProjectEditControl.asmx).

ProjectEditControl.asmx contains the custom edit form. with 3 buttons.. (Update / Cancel / Delete).

I want to pop up a confirmation on delete. I've been looking at the RadWindow and have been able to successfully replicate http://demos.telerik.com/aspnet-ajax/button/examples/confirm/defaultcs.aspx. However when trying to apply this same logic to the EditForm Delete. It doesn't error... it just doesn't launch the Window.

Any help would be great. Thank you!


UPDATE
by using the method posted  Here, I was able to get the box to prompt and to call the proper methods. BUT I then had an issue with the EditForm not closing ( I am calling  e.Item.Edit = false;).
I have tested this by removing the confirm dialog using the exact same delete code and it works perfectly (but no confirm box of course).

Upon this I decided to use the standard confirm box.
function StandardConfirm(sender, args) {
         var cancel = !window.confirm("Are you sure you want to delete this project?")
         args.set_cancel(cancel);
      }

However when I do this I get the error:
"Microsoft JScript runtime error: Object doesn't support this property or method" when trying to args.set_cancel.

Obviously I'm missing something.

Please help!


Vasil
Telerik team
 answered on 25 Aug 2011
1 answer
87 views
Hello,

How can I expand a node and all its parents (Not one parent).

Here is my code which only expands a node:
protected void GuideRadTreeView_NodeDataBound(object sender, RadTreeNodeEventArgs e)
        {
            if (e.Node.Text.Equals("Share Tests"))
            {
                e.Node.Expanded = true;
            }
        }

Please, I need your help in order to expand also its all parents until the root node.
It is very appreciated to send me the modified code.

Regards,
Bader
Bader
Top achievements
Rank 1
 answered on 25 Aug 2011
1 answer
205 views
Hi,
I need to style the RadGrid filter popup, this popup shows up when users click on the filter icon in the filter row. e.g. on this url:

http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/filtering/defaultcs.aspx

click on OrderDate Filter icon, the popup menu shows.

How do I do that?

Thanks
Princy
Top achievements
Rank 2
 answered on 25 Aug 2011
6 answers
1.2K+ views

In our application, we need to be able to return to the page with the grid, and have the grid select the row you were on before you left.

The path I have been approaching this issue from was to store the PageNumber, the ItemIndex and the NumberPerPage whenever you select a row, in session. Then the user could leave the page and when they return I could simply look for those values and set the grid accordingly. This almost worked.

The problem was that one of the things they user could do when away from the page was change data that the grid is showing. For example, my grid lists Locations is sorted by the Location's Trading Name.

If they select the first row in the grid ('ACME'), then leave that page and in another part of the site and change the Trading Name of that location to 'Z-Acme', returning the grid, the wrong row will be selected. Furthermore, it will most likely be on the wrong page.

What I need is a concrete way to store some value, and to have the grid find and select the correct row based on that value.Regardless of where that row is now.  No matter what page or item index.

I did this code (hardcoded for now) but this only finds the row if it is in the currently loaded set.
protected void rgLocations_DataBound(object sender, EventArgs e)
        {
            string SBingo = String.Empty;
 
            for(int i = 0; i < rgLocations.Items.Count; i++)
            {
                if (rgLocations.Items[i]["Trading_Name"].Text == "Z-Acme")
                {
                    SBingo = "Found it";
                }
            }
        }

This is not ideal for a couple of reasons.

1. As mentioned above it only searches the records currently returned (which might be just 10 records out of a set of 1000s)

2. The search criteria is based on the Trading Name. As two or more locations 'might' have the same Trading Name in my app, this is far from ideal. I'd like this based on the Primary Key ID of each row. Note: the Primary key is not displayed in the grid. Can the RadGrid store but not display the primary key from each row?

What I'd like is some generic function that takes 2 parameters.
 
SetGrid(ref RadGrid r, int ItemID)

I just pass it the grid I want to set and the item ID of the row I want selected.

This code would need to happen before the grid is bound to the data source I would think. But I'm not sure.

Problem is I can't see how to do this. The RadGrid seems to work in blocks of data that are 'PageSize' in size.

Anyone done something similar? This seems like pretty basic stuff that should be part of the RadGrid. Maybe I'm just missing it.

Brad
















Brad
Top achievements
Rank 1
 answered on 25 Aug 2011
1 answer
116 views
Hi,

When I use Aggregate function in RadGrid, footer display "Sum: xxx" or other titles depending on type of aggregate functions, is there a way to just display aggregate results without the titles?

TIA
Princy
Top achievements
Rank 2
 answered on 25 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?