Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
405 views
within a GridTemplateColumn I pouplate the text property of a literal control depending on some database driven logic.

If case x set literal.text = database column x
if case y set literal.text = database column y

Since then the GridTemplateColumn can contain data from different columns I do not declaratively set the SortExpression property of the GridTemplateColumn.

How do I (in what event?) set the SortExpression property of the GridTemplateColumn programatically to be x or y?
Sebastian
Telerik team
 answered on 29 Sep 2009
1 answer
169 views

Hello All,

I have a small problem with own Business classes because there should be a method how to update Server side variables from Client side.

Situation is followig: Application opens modal Popup RadWindow and user can make queries to database in that window.

User can also select rows she wants and selected rows are put into their own RadGrid. When user closes her Popup Window rows containing user selected rows should be passed as Business Objects into Popup Window's Parent Window.

I heard somewhere that it's possible to make an Ajax Extender of own Business class so that when it's value changes it changes in both client and server side. Is this possible and if it is how to do it?

I have Googled a lot's of articles considering this issue but haven't get a picture how to actually do it.

Articles also contains specific information about Ajax Control Toolkit environment so, when I'm using Telerik's Asp.Net Ajax Components it's difficult to port Toolkit's classes and their methods into Telerik's.

So can anyone help me?

I work as a developer in a company which has licenses to Telerik products.

Thanks,

Michael

Sebastian
Telerik team
 answered on 29 Sep 2009
1 answer
149 views
Hi All.

major hassle her,.. this ran nicely under the 2006.4 controls, but multiple errors and issues now.
I have bolded anditalicised them.

I have tried the demos and and and but to no avail.

Essentially:
1)  I have a menu within a Expanding/collapsing PanelBar which itself is in a Radpane within a Radsplitter. ie similar to Outlook left pane and Right Content pane.
The menu is databound, post a login, and depending on User Role different data / menu items re loaded.
Notably Either Admin or Broker (Wildlife insurance app).

If I try the menu's  OnClientItemClicking , this event does not fire.
I try this 

var

 

splitter = window["<%= RadSplitter2.ClientID %>"]; 

 

var

 

pane = splitter.GetPaneById("ContentPane");

 

pane.SetContentUrl(url);

 

var url = eventArgs.Item.NavigateUrl;

I've tried wrapping it in RadCodeBlock because of the server var as well....No Go.

This script error this leads to another error, in my pageload event i call a function which checks a server var for whether the user has validly logged in else it pops up a RadWindow Login.
This now will only fire if I Ctl-F5 - refresh the page, but not on initial load.

I tried substituting the above script with, the one as used in your demo for this,
i.e.

 

var

 

splitter = $find("RadSplitter2");
but the event will not fire anyway,..s0  whether i put the Script in the head, the top of the body , the bottom of it, whather I try wrapping the whole body content in a rad ajax pane,..nothing.

and if I click on the menu item,...the page I want in my content pane, loads in a new window!

Oh and of course the Radpane, panel bar, resize themselves to a few millimetres in width after the menu items are loaded from Db,..once actually logged in.
I am Currently using V 2009.1

Code behind is minor, just databinding and

 

 

protected void RadMenu1_OnItemDataBound(object sender, RadMenuEventArgs e)

 

{

 

RadMenuItem ei = e.Item as RadMenuItem;

 

ei.Target =

"ContentPane";

 

}

 

And ..of course I have deadlines for my clients and fees being Tuesday.  "Sweating!!"

the markup is included beneath: 
Many Thanks
Neal

 

<%

@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

 

 

 

 

 

Namespace="System.Web.UI" TagPrefix="asp" %>

 

<%

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

 

 

 

<!

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd">

 

<

 

html>

 

 

 

 

 

<head id="Head1" runat="server">

 

 

 

 

 

<link rel="stylesheet" type="text/css" href="~/RootStyle.css"/>

 

 

 

 

 

</head>

 

 

 

 

 

 

<body topmargin=10 leftmargin=0 onload="CheckCloseRefresh()" scroll="yes">

 

 

 

 

 

<form id="form1" runat="server" method="post" >

 

 

 

 

 

 

<asp:scriptmanager ID="Scriptmanager2" runat="server"></asp:scriptmanager>

 

 

 

 

 

 

 

<script language="javascript" type="text/javascript">

 

 

 

 

 

 

function CheckCloseRefresh()

 

{

 

var ShowLogin = <%= Show %>;

 

 

 

if (ShowLogin == true)

 

{

Login();

}

}

 

 

function Login()

 

{

 

var urlExtn = "ms=" + new Date().getTime();

 

 

var oWnd = radopen("Forms/Auth/Login.aspx?" + urlExtn , "Login");

 

}

 

 

function Menu_OnClientItemClicked(sender, eventArgs)

 

{

alert(

"menu clicked");

 

 

var splitter = $find("RadSplitter2");

 

 

var pane = splitter.GetPaneById("ContentPane");

 

pane.SetContentUrl(url);

 

var url = eventArgs.Item.NavigateUrl;

 

}

 

 

</script>

 

 

 

 

 

 

 

<telerik:RadWindowManager

 

 

ID="RadWindowManager1"

 

 

 

 

 

runat="server"

 

 

 

 

 

>

 

 

 

 

 

 

<Windows>

 

 

 

 

 

<telerik:RadWindow

 

 

ID="Login"

 

 

runat="server"

 

 

 

 

 

Width="600px"

 

 

 

 

 

Height="245px"

 

 

 

 

 

Modal="true"

 

 

 

 

 

Top="250"

 

 

 

 

 

Left="400"

 

 

 

 

 

BackColor="lightgray"

 

 

 

 

 

>

 

 

 

 

 

</telerik:RadWindow>

 

 

 

 

 

</Windows>

 

 

</telerik:RadWindowManager>

 

 

 

 

 

 

<!-- Div obox(GradientBackGround) -->

 

 

 

 

 

<div id="oBox"

 

 

 

 

 

class="oBox"

 

 

 

 

 

>

 

 

 

 

 

 

<!-- Div Top Center Text -->

 

 

 

 

 

<div id="DivTopText"

 

 

align="center"

 

 

class="DivTopText"

 

 

 

 

 

style="font-family:Lucida Calligraphy; font-size:large; color:Gold" >

 

Equine & Wildlife Insurance

 

</div>

 

 

</div>

 

 

 

<div id="UserInfo" align="right" style="width:100%; left:0;">

 

 

 

 

 

 

</div>

 

 

 

 

 

 

<div id="Main" style="position:absolute; top:70px; left:0px; width:100%; ">

 

 

 

 

 

<asp:Label ID="lblInfo" runat="server" Enabled="false"

 

 

text="Press the 'F11' key on your keyboard to run in Fullscreen"></asp:Label>

 

 

 

 

 

<telerik:radsplitter id="RadSplitter1" runat="server"

 

 

Height ="900px" width="100%"

 

 

Skin="Telerik"

 

 

liveresize="true"

 

 

orientation="Vertical"

 

 

 

 

 

BorderColor="Transparent"

 

 

 

 

 

BorderSize="1"

 

 

 

 

 

BorderStyle="None" BackColor="Transparent">

 

 

 

 

 

 

<telerik:radpane

 

 

Height="97%"

 

 

 

 

 

id="navigationPane" runat="server"

 

 

 

MaxWidth="300"

 

 

MinHeight="500"

 

 

MinWidth="75" Width="15%"

 

 

 

 

 

BackColor="DimGray">

 

 

 

 

 

 

<telerik:RadPanelbar ID="RadPanelbar1" runat="server"

 

 

Width="100%" PersistStateInCookie="True" >

 

 

 

 

 

<Items>

 

 

 

 

 

<telerik:RadPanelItem Text="Admin" Height="50%" Width="100%"

 

 

Expanded="True" runat="server" CssClass="FrmHdrMnuGrdnt">

 

 

 

 

 

<Items >

 

 

 

 

 

<telerik:RadPanelItem runat="server" Selected="True"

 

 

CssClass="FrmHdrMnuGrdnt" Width="100%">

 

 

 

 

 

<ItemTemplate >

 

 

 

 

 

<telerik:RadMenu ID="RadMenu1"

 

 

runat="server"

 

 

Flow="Vertical" Width="100%" Height="100%"

 

 

 

 

 

skin="Equistar"

 

 

 

 

 

EnableEmbeddedSkins="false"

 

 

 

 

 

DataFieldID="ScreenId"

 

 

DataFieldParentID="ParentScreenId"

 

 

 

DataNavigateUrlField="Screen"

 

 

DataTextField="Title"

 

 

DataValueField="ScreenId"

 

 

OnItemDataBound="RadMenu1_OnItemDataBound"

 

 

OnClientItemClicking="Menu_OnClientItemClicked"

 

 

 

 

 

>

 

 

 

</telerik:RadMenu>

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

</telerik:RadPanelItem>

 

 

 

 

 

 

</Items>

 

 

 

 

 

</telerik:RadPanelItem>

 

 

 

 

 

 

<telerik:RadPanelItem Text="Brokers" Expanded="True"

 

 

Height="50%" runat="server" CssClass="FrmHdrMnuGrdnt">

 

 

 

 

 

<Items>

 

 

 

 

 

<telerik:RadPanelItem runat="server">

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

<telerik:RadMenu ID="Radmenu2" runat="server"

 

 

 

Flow="Vertical" Width="99%" Height="99%"

 

 

 

 

 

skin="Equistar"

 

 

 

 

 

EnableEmbeddedSkins="false"

 

 

 

 

 

DataFieldID="ScreenId"

 

 

DataFieldParentID="ParentScreenId"

 

 

DataNavigateUrlField="Screen"

 

 

DataTextField="Title"

 

 

DataValueField="ScreenId"

 

 

OnItemDataBound="RadMenu2_OnItemDataBound"

 

 

OnClientItemClicking="Menu_OnClientItemClicked">

 

 

 

 

 

</telerik:RadMenu>

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

</telerik:RadPanelItem>

 

 

 

 

 

</Items>

 

 

 

 

 

</telerik:RadPanelItem>

 

 

 

 

 

</Items>

 

 

 

 

 

</telerik:RadPanelbar>

 

 

 

 

 

</telerik:RadPane>

 

 

 

 

 

 

<telerik:radsplitbar id="RadSplitbar1" runat="server"

 

 

CollapseMode="Both"

 

 

 

 

 

EnableResize="True"

 

 

EnableTheming="False"

 

 

ResizeStep="1"

 

 

 

 

 

 

BorderColor="BlanchedAlmond"

 

 

 

 

 

BorderStyle="solid"

 

 

 

 

 

BorderWidth="1px"

 

 

 

 

 

Width="10px">

 

 

 

 

 

</telerik:radsplitbar>

 

 

 

 

 

 

<telerik:radpane id="RadPane2" runat="server"

 

 

BackColor="White"

 

 

height="97%"

 

 

Width="100%"

 

 

 

 

 

 

> <!--

 

Nester Horizontal splitter

-->

 

 

 

 

<telerik:radsplitter id="RadSplitter2" runat="server"

 

 

liveresize="true"

 

 

orientation="Horizontal"

 

 

Skin="Telerik" Height="99%" Width="100%">

 

 

 

 

 

 

<telerik:radpane id="ContentPane"

 

 

runat="server"

 

 

 

 

 

height="99%"

 

 

width="99%"

 

 

 

 

 

MinHeight="250"

 

 

ContentUrl="EquistarMain.aspx"

 

 

 

 

 

MinWidth="500"

 

 

 

>

 

 

 

 

 

</telerik:radpane>

 

 

 

 

 

 

</telerik:radsplitter>

 

 

 

 

 

 

</telerik:radpane>

 

 

 

 

 

</telerik:radsplitter>

 

 

 

 

 

</div>

 

 

 

 

 

</form>

 

 

 

 

 

</body>

 

</

 

html>

 

 

 

Paul
Telerik team
 answered on 29 Sep 2009
3 answers
139 views

Hi,

I am trying to set the default value on 3 GridDropDownColumn's in an auto generated edit form.  I have the following code in the grids item event (based on sample code).  The problem is while this works correctly for text based fields the drop down lists are not set.

protected void rgAppointments_ItemCommand(object source, GridCommandEventArgs e)  
{  
  if (e.CommandName == RadGrid.InitInsertCommandName) //"Add new" button clicked  
  {  
    if (ViewState["LAST_APPOINTMENT"] != null)  
    {  
      AppointmentSave lstApp = (AppointmentSave)ViewState["LAST_APPOINTMENT"];  
      e.Canceled = true;  
      //Prepare an IDictionary with the predefined values  
      System.Collections.Specialized.ListDictionary newValues = new System.Collections.Specialized.ListDictionary();  
      newValues["staff_member_id"] = lstApp.StaffMember;  
      newValues["appointment_type_id"] = lstApp.AppointmentType;  
      newValues["location_id"] = lstApp.Location;  
      //Insert the item and rebind  
      e.Item.OwnerTableView.InsertItem(newValues);  
    }  
  }  
} 

The version of the controls I am using is 2008.3.1125.20.

How do I get this to work or am I going to have to switch to a template to do this?

Thanks

Gavin

Princy
Top achievements
Rank 2
 answered on 29 Sep 2009
2 answers
113 views
Hi,

I am trying to find out how to change the viewed month of the calendar from the backend code. I need next and prev buttons that change both a Scheduler and the Calendar.

When I set the calendars SelectedDate, the view is not updated to the month of the new date. How do I do this?

Thanks,
Rune
Rune
Top achievements
Rank 2
 answered on 29 Sep 2009
1 answer
197 views
I have a problem handling the inserts to a grid using "InPlace" edit and "MultiROwEdit".
The Grid is bound to a DataSet (SQL) table.  I want to be able to keep inserting multiple rows (items) into the grid and edit them.
The "AllowAutomaticInserts" is set to false.  I am catching the insert events in "OnItemDataBound" handler.

In there, I am creating a new 'empty' data row and adding it to the table.  Then, I bind the row to inserted item, make it aditable, and finally I change "IsItemInserted" to false to allow for more inserts.

DataTable.AddRow(row);  // add row to table

insert_Item.DataItem = row;

insert_Item.Edit =

true;

 

rdgrd.MasterTableView.IsItemInserted =

false;

This turns the last item in the grid into regular, non-editable item unless Refresh is pressed.
I was wondering wether there is a cleaner way of doing multiple inserts to a grid where all rows are turned into editable items.  I could not find any single example exploring this scenario.

Thank you,
Chris

 

Veli
Telerik team
 answered on 29 Sep 2009
5 answers
291 views
I was reviewing another set of ASP.net controls and they provide the ability to Mass update their grid.  An example would be that I have a grid populated with data.  I would like to use an outside form to find all values in the grid that are X and replace it with Y.  Is that possible with the RadGrid?  If so, is there an example?
Sebastian
Telerik team
 answered on 29 Sep 2009
1 answer
140 views
I have the following declaration, and my tick marks aren't showing.

Thoughts?
<telerik:RadSlider ID="rdSlider" runat="server" OnClientValueChange="HandleValueChange"  
                OnClientLoaded="HandleValueChange" Width="135"  
                CausesValidation="false" Visible="true" TrackPosition="Center" 
                OnValueChanged="rdSlider_ValueChanged" AutoPostBack="true" ItemType="Tick" LargeChange="100"> 
            </telerik:RadSlider> 

Tsvetie
Telerik team
 answered on 29 Sep 2009
1 answer
85 views
Dear Telerik Team,

I just wonder ,is there any way to make the users to enter only the numeric values in the edit box of the calendar ? currently it accepts the alphabets as well.

Shinu
Top achievements
Rank 2
 answered on 29 Sep 2009
3 answers
140 views
Hi,

I want to raise an event when I empty the combo's text, what can I do? Is there any event described for this purpose?

thanks
Vesko
Top achievements
Rank 2
 answered on 29 Sep 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?