Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
109 views
hi

I have a  radmenu with default skin.

When i set URL routing in Global.asax to

routes.MapPageRoute(

"login", "{*username}", "~/login.aspx")
it losses all its CSS and theme.

But when i set it to  

routes.MapPageRoute("login", "login/{*username}", "~/login.aspx")
it display normal with all its CSS and theme.

Why it isn't working for the first routing? thanks

 

Kate
Telerik team
 answered on 07 Feb 2012
2 answers
118 views
Hi,

I have some RadGrids on a page, and I'd like a loading panel to show up during AJAX calls. For example, let's focus on a virtual scrolling grid.

On this demo page, we can see virtual scrolling, and a loading panel showing up as you scroll. For some reason, no matter what I try, I can't get the loading panel to show. The AJAX magic does work, though.

Are there common pitfalls that I should be aware of, or something?

My code:
In a first control:

<telerik:RadScriptManager ID="scriptManager" runat="server" />
 
(...)
 
<telerik:RadAjaxManager ID="ajaxManager" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="resultGrid">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="resultGrid" LoadingPanelID="resultAjaxPanel"/>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

In a sub control:

<telerik:RadAjaxLoadingPanel ID="resultAjaxPanel" runat="server" />
 
<telerik:RadGrid ID="resultGrid" runat="server" AutoGenerateColumns="False" ShowHeader="False"
    AllowPaging="True" PageSize="30" PagerStyle-Visible="false" CellSpacing="0" GridLines="None" OnItemCreated="resultGrid_ItemCreated" OnItemCommand="resultGrid_ItemCommand" OnItemDataBound="resultGrid_ItemDataBound">
<MasterTableView>
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
 
    <Columns>
        <telerik:GridMaskedColumn UniqueName="idColumn" FilterControlAltText="Filter idColumn column" DataField="Id" Visible="false">
        </telerik:GridMaskedColumn>
        <telerik:GridBoundColumn DataField="Extension" FilterControlAltText="Filter extensionColumn column" UniqueName="extensionColumn">
            <ItemStyle Width="20px" CssClass="extensionColumn" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Title" FilterControlAltText="Filter linkColumn column" UniqueName="linkColumn">
            <ItemStyle CssClass="titleColumn" />
        </telerik:GridBoundColumn>
        <telerik:GridTemplateColumn>
            <ItemTemplate>
                <a href='<%# this.ResolveUrl("Preview.ashx?" + Insite.Web.Widgets.FilterSearch.Preview.IdParam + "=" + Eval("Id")) %>' target='_blank'><asp:Image ImageUrl="~/Widgets/FilterSearch/images/icon_loupe.png" runat="server" /></a>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Right" Width="16px" />
        </telerik:GridTemplateColumn>
        <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="Add"
            FilterControlAltText="Filter addColumn column" UniqueName="addColumn" Text="ADD">
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle HorizontalAlign="Right" Width="30px" CssClass="addColumn" />
        </telerik:GridButtonColumn>
    </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
</MasterTableView>
 
<ClientSettings>
    <Scrolling AllowScroll="True" EnableVirtualScrollPaging="true" SaveScrollPosition="True">
    </Scrolling>
</ClientSettings>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
 
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
 
</telerik:RadGrid>
Thomas
Top achievements
Rank 1
 answered on 07 Feb 2012
1 answer
117 views
Hi,

I have a grid control to which I add a GridButtonColumn. Later, I add an OnClick client event. This part works fine. The image is displayed within each row of the grid and if I click on the image, the javascript function is executed.

Now from within the javascript function, I want to access a value from the grid. The value should come from the row which contains the button which was clicked on. Looking on the internet, I have managed to find out how to get this to work if a row has been selected. The problem is that when you click on a grid button, the row containing the grid button is not necessarily selected e.g. If I first select a row and then click on the button, I can get the value, but if I just click on one of the buttons without first selecting a row, I am aunable to determine the row containing the button. The clicked button itself is inside a specific row so there must be some way to get it.

Below are a few snippets of relevent code. Any help would be greatly appreciated.

Creating the button:

var inchisIncomingEmail = new GridButtonColumn();
grid.MasterTableView.Columns.Add(inchisIncomingEmail);

Adding the onclick event to the button
if (e.Item is GridDataItem)
            {
                GridDataItem item = (GridDataItem)e.Item;
                ImageButton btnColumn1 = (ImageButton)item["objhisIncomingEmailID"].Controls[0];
                btnColumn1.Attributes.Add("OnClick", "IncomingEmailClick()");
            }

client side javascript event handler. Only works as expected if a row is selected prior to clicking on the button - even though the button itself is inside a specific row.
function IncomingEmailClick(obj, args) {
            IncomingEmailOpenWindow('<%=ResolveUrl("~/Modules/Common/HistoryDetail.aspx") %>', obj, null);
        }
 
        function IncomingEmailOpenWindow(url, grid, closeFn) {
            var gridc = $find("<%=grid.ClientID%>");
            var items = gridc.get_masterTableView().get_selectedItems();
             
            if (items.length > 0) {
                url = url + '?id=' + items[0].getDataKeyValue('objhisID') + '&type=<%=(int)ListType %>' + '&objId=<%=ItemGuid %>';
            }
            var win = radopen(url, null);
            win.set_modal(true);
            win.setActive(true);
            if (closeFn != null) {
                win.OpenerWindowCloseFn = closeFn;
            }
        }

Ryan
Top achievements
Rank 1
 answered on 07 Feb 2012
2 answers
105 views
hi

based on the example you have http://demos.telerik.com/aspnet-ajax/scheduler/examples/resourceheadertemplates/defaultvb.aspx
where your 4 speakers has static settings in the resource style and mapping.

I am having an eviromment where my speakers are very dynamic. we engage many different speakers on an assignment basis and we insert speaker as we engage them and delete them when don't require their speaking engagement.

Grouping is done vertically and we uses Timeline to display speakers on the left without displaying time.

How do i go about it doing dynamically?

Thanks
Ivana
Telerik team
 answered on 07 Feb 2012
1 answer
204 views
Here is my requirement, when user clicks on a appointment in Month View, say he clicks one appointment on 2nd Feb, and then user selects to go to day view, calendar should go to 2nd Feb.
 I checked the online demos , this is not a default feature of scheduler. I have added a javascript on appointment click to change the selected date, but somehow it is not working, here is the js I am trying
calendarView.set_selectedDate(eventArgs.get_appointment().get_start());
   eventArgs.get_appointment().set_selected();
Ivana
Telerik team
 answered on 07 Feb 2012
1 answer
128 views
Hello,

I'm using filtering on my grid. When the user selects a filter the "Item_Command" event is triggered where I can retrieve the Filter pair from the command argument. From this argument I can get the "filterPair.first", "filterPair.second", ..etc. Using this approach I can get access to the column name that the user is filtering, but I need the associated Column ID. Is it possible to associate more data with this filter or command argument? Maybe I could add an attribute to the filter Textbox when the filter is created, then read it on ItemCommand? 

Please let me know if you have suggestions on the best approach.

protected void grdSummary_ItemCommand(object source, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.FilterCommandName)
    {
        Pair filterPair = (Pair)e.CommandArgument;
 
        string strOperator = filterPair.First;    // Starts With, ..etc
        string strColumn = filterPair.Second;    // Column Filtering On
        string searchValue = ((TextBox)(e.Item as GridFilteringItem)[filterPair.Second.ToString()].Controls[0]).Text;
           string columnId = ?? 
Tsvetoslav
Telerik team
 answered on 07 Feb 2012
1 answer
82 views
function SelectRows()
{         
   var masterTable = $find("<%= CandidatesGrid.ClientID %>").get_masterTableView();
   var row = masterTable.get_dataItems();
    for(i =0;i<row.length;i++)
    {
          var check=masterTable.get_dataItems()[i].getDataKeyValue("Check");
          if(check !=0)
          {
                masterTable.get_dataItems()[i].set_selected(true);              
          }
           else
           {            
                 masterTable.get_dataItems()[i].set_selected(false);  
                // How to disable the row here?      
                        
           }
  }
  
 }
How to disable a particular row in RadGrid using javascript(i am using GridClientSelectColumn to select a row)?
Princy
Top achievements
Rank 2
 answered on 07 Feb 2012
5 answers
131 views

I have a simple test project. 

One panel executes a timer every 4 seconds (a long running task).

Another panel has a button that will redirect to another page.

Each panel is added to the radajaxmanager ajaxsettings

When the timer is executing, the button on the second panel never executes (although the loading panel is shown). So the new page isn't shown.

This is the code I use:

protected void Page_Load(object sender, EventArgs e)
    {
        RadAjaxManager1.RequestQueueSize = 3;
          
        // Panel 1
        Panel panel = new Panel();
        panel.Height = 200;
        panel.Width = 200;
        panel.BorderColor = System.Drawing.Color.Green;
        panel.BorderWidth = 3;
        panel.BorderStyle = BorderStyle.Solid;
        panel.ID = "NewPanel";
        Label newLabel = new Label();
        newLabel.ID = "NewLabel";
        panel.Controls.Add(newLabel);
        Timer newTimer = new Timer();
        newTimer.ID = "newTimer";        
        newTimer.Interval = 4000;
        newTimer.Enabled = true;         
        newTimer.Tick += newTimer_Tick;
        panel.Controls.Add(newTimer);
  
        RadButton newButton = new RadButton();
        newButton.ID = "newButton";
        newButton.Click += newButton_Click;
        panel.Controls.Add(newButton);
                  
        form1.Controls.Add(panel);
  
        // Panel 2
        Panel panel2 = new Panel();
        panel2.Height = 200;
        panel2.Width = 200;
        panel2.BorderColor = System.Drawing.Color.Beige;
        panel2.BorderWidth = 3;
        panel2.BorderStyle = BorderStyle.Solid;
        panel2.ID = "NewPanel2";
        Label newLabel2 = new Label();
        newLabel2.ID = "NewLabel2";
        panel2.Controls.Add(newLabel2);
  
        RadButton newButton2 = new RadButton();
        newButton2.ID = "newButton2";
        newButton2.Click += newButton2_Click;
        panel2.Controls.Add(newButton2);
  
        form1.Controls.Add(panel2);
  
        RadAjaxManager1.AjaxSettings.AddAjaxSetting(panel, panel);
        RadAjaxManager1.AjaxSettings.AddAjaxSetting(panel2, panel2);
    }
  
    void newButton2_Click(object sender, EventArgs e)
    {
        System.Threading.Thread.Sleep(500);        
        this.Page.Response.Redirect("~/Test.aspx");
    }
  
    void newButton_Click(object sender, EventArgs e)
    {
        System.Threading.Thread.Sleep(500);
        Label lbl = Page.FindControl("NewLabel") as Label;
        lbl.Text = System.DateTime.Now.ToString();
    }
    void newTimer_Tick(object sender, EventArgs e)
    {
        System.Threading.Thread.Sleep(3000);
        Label lbl = Page.FindControl("NewLabel") as Label;
        lbl.Text = System.DateTime.Now.ToString();
    }
}

Maria Ilieva
Telerik team
 answered on 07 Feb 2012
0 answers
71 views
Hi all,
i am facing problem doing group on table how can i write this sql query into linq c#

select
UserProfile.ID,
UserProfile.FirstName+' '+UserProfile.LastName UserName,
IsNull(CurrentBid.[Current],0)CurrentBid,
IsNull(WinnerBid.Winner,0)WinnerBid,
IsNull(LoseBid.Lose,0)LoseBid,
IsNull(CancelledBid.Cancel,0)CancelledBid
from UserProfile
left join
(
select count(BidTransactions.ID) [Current],UserID
from BidTransactions where
IsCloseBid= null or IsCloseBid = 0
group by UserID)CurrentBid on CurrentBid.UserID = UserProfile.ID
left Join (
select count(BidTransactions.ID) [Winner] ,UserID
from BidTransactions where
IsCloseBid= 1 AND IsWinnerBid = 1
group by UserID)WinnerBid on WinnerBid.UserID = CurrentBid.UserID
left Join(
select count(BidTransactions.ID) [Lose],UserID
from BidTransactions where
IsCloseBid= 1 AND IsWinnerBid = 0
group by UserID)LoseBid on LoseBid.UserID = CurrentBid.UserID
left join(
select count(BidTransactions.ID) [Cancel],UserID
from BidTransactions where
IsCancelled = 1
group by UserID) CancelledBid on CancelledBid.UserID = CurrentBid.UserID
where UserProfile.RoleName in ('Sellers','Bidders')
kd
Top achievements
Rank 1
 asked on 07 Feb 2012
1 answer
27 views
Hi guys,
I have following code in aspx:

<

 

 

telerik:RadScriptManager ID="ScriptManager1" runat="server" />

 

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

 

<ClientEvents OnRequestStart="onRequestStart" />

 

 

 

<AjaxSettings>

 

 

 

<telerik:AjaxSetting AjaxControlID="mainPanel">

 

 

 

<UpdatedControls>

 

 

 

<telerik:AjaxUpdatedControl ControlID="mainPanel" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

 

</UpdatedControls>

 

 

 

</telerik:AjaxSetting>

 

 

 

 

</AjaxSettings>

 

 

 

</telerik:RadAjaxManager>

 

 

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" EnableSkinTransparency ="true" runat="server">

 

 

 

</telerik:RadAjaxLoadingPanel>

 


I have following code in c#:

protected

 

 

void Button_Click(object sender, EventArgs e)

 

{

 

 

string reqno = string.Empty;

 

 

 

string status = string.Empty;

 

 

 

string fyear = FYear.ToString();

 

 

 

SecureQueryString param = new SecureQueryString();

 

param.Add(

 

"ReqnoId", reqno);

 

param.Add(

 

"StatusId", status);

 

param.Add(

 

"Fyear", fyear);

 

 

 

string url = "~/PerSession/PRRequest/PrincipalRequest.aspx?data=" + param.ToString();

 

Response.Redirect(url);

 

}


In VS2005 it works fine.When I converted to VS2010 and try to click on button above to redirect I am gettig this error:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '�'.

When I comment out this code:

<UpdatedControls>

 

 

 

<telerik:AjaxUpdatedControl ControlID="mainPanel" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

 

</UpdatedControls>

 

 it works fine but progress bar now does not working.
Please help me to resolve this issue.
Tsvetoslav
Telerik team
 answered on 07 Feb 2012
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?