Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
173 views
hi

I'm using radgrid for PopUp editing mode
I have two template columns.
In the "Insert" mode i want to enable the two text boxes.
But in edit - update mode i want to disable the first text box.
How can we achieve this?

This is my aspx code:

<

 

MasterTableView EditMode="PopUp" CommandItemDisplay="Top" DataKeyNames="Customer _ID" DataSourceID="sdsCustomer" Width="100%">

 

 

<Columns>

 

<

 

telerik:GridTemplateColumn DataField="Customer_ID" Visible="false" HeaderText="Customer ID"

 

 

SortExpression="Customer_ID" UniqueName="Customer_ID">

 

 

<ItemTemplate>

 

 

<asp:Label ID="Customer_IDLabel" runat="server" Text='<%# Eval("Customer_ID") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

<EditItemTemplate>

 

 

<asp:TextBox ID="Customer_IDTextBox" Width="200px" runat="server"

 

 

Text='<%# Bind("Customer_ID") %>'></asp:TextBox>

 

 

</EditItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn DataField="Customer_Name" HeaderText="Name"

 

 

SortExpression="Customer_Name" ItemStyle-Wrap="false" UniqueName="Customer_Name">

 

 

<EditItemTemplate>

 

 

<asp:TextBox ID="Customer_NameTextBox" Width="200px" runat="server"

 

 

Text='<%# Bind("Customer_Name") %>'></asp:TextBox>

 

 

</EditItemTemplate>

 

 

<ItemTemplate>

 

 

<asp:Label ID="Customer_NameLabel" runat="server"

 

 

Text='<%# Eval("Customer_Name") %>'></asp:Label>

 

 

</ItemTemplate>

 

<

 

ItemStyle Wrap="False"></ItemStyle>

 

 

</telerik:GridTemplateColumn>

 

</

 

Columns>

 



I am using this code:

 

Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs)

 

If (TypeOf e.Item Is GridEditableItem) AndAlso (e.Item.IsInEditMode) Then

 

 

 

Dim edititem As GridEditableItem = DirectCast(e.Item, GridEditableItem)

 

 

Dim txtbx As TextBox = DirectCast(edititem("Customer_ID").Controls(0), TextBox)

 

 txtbx.Enabled =

False

 

 

 

End If

 

 

 

End Sub

But it don't seems to work. Thanks

 

 

 

 

 

Mira
Telerik team
 answered on 15 Sep 2009
5 answers
211 views
I have code that binds a generic list of resources through a linqdatasource on the server side. I would like to be able to access some of the resource attributes client side. For example, I have a data key called "RoomEmail" that I would like to be able to access from the client. I tried adding the the key to the CustomAttributeNames property but the _attributes array still shows no items for each room when I pull it up in firebug. How can I pass the data to the client side?

<asp:UpdatePanel ID="UpdatePanel1" runat="server"
                            <ContentTemplate> 
                                <telerik:RadScheduler runat="server" ID="RadScheduler1" SelectedView="TimelineView" 
                                    OnAppointmentDataBound="RadScheduler1_OnAppointmentDataBound" TimelineView-HeaderDateFormat="D" 
                                    DataSourceID="dsEventsDataSource" Skin="Office2007" GroupBy="Room" GroupingDirection="Vertical" 
                                    DayStartTime="08:00:00" DayEndTime="23:30:00" TimeZoneOffset="03:00:00" DataKeyField="Conf_ID" 
                                    DataSubjectField="Conference_Name" DataStartField="Start" DataEndField="End" 
                                    OverflowBehavior="Expand" ShowViewTabs="false" ColumnWidth="10px" Width="950px" 
                                    Height="400px" CustomAttributeNames="Conf_ID,Name,RoomID,RoomEmail" OnAppointmentCommand="RadScheduler1_OnAppointmentCommand" 
                                    OnResourceHeaderCreated="RadScheduler1_ResourceHeaderCreated" RowHeight="40px" 
                                    MultiDayView-NumberOfDays="2" RowHeaderWidth="100px" EnableDatePicker="false" 
                                    ShowNavigationPane="false" AllowInsert="false" AllowEdit="false" AllowDelete="false"
                                    <AdvancedForm Modal="true" /> 
                                    <TimelineView NumberOfSlots="192" SlotDuration="0:15" ColumnHeaderDateFormat="h tt" 
                                        TimeLabelSpan="4" /> 
                                    <ResourceTypes> 
                                        <telerik:ResourceType KeyField="RoomID" Name="Room" TextField="Name" ForeignKeyField="RoomID" 
                                            DataSourceID="dsRoomsDataSource" /> 
                                    </ResourceTypes> 
                                    <ResourceHeaderTemplate> 
                                        <asp:LinkButton ID="btnRemove" runat="server" Text="X" CommandName="RemoveResource" 
                                            CausesValidation="false" CssClass="ui-icon ui-icon-trash" Style="float: left" 
                                            OnClientClick="return confirm('Are you sure you want to remove this room?')" />&nbsp; 
                                        <asp:Label ID="ResourceLabel" runat="server" /> 
                                    </ResourceHeaderTemplate> 
                                </telerik:RadScheduler> 
                                <asp:LinqDataSource ID="dsEventsDataSource" runat="server" OnSelecting="dsEventsDataSource_OnSelecting"
                                </asp:LinqDataSource> 
                                <asp:LinqDataSource ID="dsRoomsDataSource" runat="server" OnSelecting="dsRoomsDataSource_OnSelecting"
                                </asp:LinqDataSource> 
                            </ContentTemplate> 
                        </asp:UpdatePanel> 





protected void dsRoomsDataSource_OnSelecting(object sender, LinqDataSourceSelectEventArgs e) 
    { 
        e.Result = Rooms; 
    } 
 
public class Room 
    { 
        public Guid RoomID { getset; } 
        public string Name { getset; } 
        public bool Host { getset; } 
        public bool Presenting { getset; } 
        public int Attendees { getset; } 
        public bool ClientsPresent { getset; } 
        public string RoomEmail { getset; } 
        public string Tools { getset; } 
        public string Comments { getset; } 
        public List<RoomSchedule> Schedules { getset; } 
    } 


Peter
Telerik team
 answered on 15 Sep 2009
3 answers
287 views
I'm trying to databind a datatables DATETIME column to the  X-Axis Labels from code behind but I keeping getting this error.
Unable to cast object of type 'System.DateTime' to type 'System.String'.

From the DATETIME, I only want to use the month and year.  Any ideas. Thanks in advance
Schlurk
Top achievements
Rank 2
 answered on 15 Sep 2009
1 answer
88 views
Hi,
I have this code:
RadTreeView radTreeView = (RadTreeView)RadComboBox1.Items[0].FindControl("RadTreeView1"); 
 
            IList<CoorIS.DomainObjects.Unit> units = UnitService.GetUnitsAsExpanded(PageInfo.CurrentUnitID, Guid.Empty); 
            radTreeView.DataSource = units; 
            radTreeView.DataTextField = "Name"
            radTreeView.DataValueField = "ID"
            radTreeView.DataFieldID = "ID"
            radTreeView.DataFieldParentID = "ParentID"
            radTreeView.DataBind(); 
 
             
            RadTreeNode node = radTreeView.FindNodeByValue(PageInfo.CurrentUnitID.ToString()); 
            if (node != null
            { 
                node.ExpandParentNodes(); 
                node.Selected = true
                 
                RadComboBox1.SelectedItem.Text = node.Text; 
            } 

The node is selected but I don't see it cause it doesn't apply the selected style, why?
I have to click on the node to see the correct style.
(I'm using 2009.02.0701.35)

Atanas Korchev
Telerik team
 answered on 15 Sep 2009
1 answer
144 views
Hi,

Why make a hover effect if the user is a guest and he cannot create any appointments?

Is it possible to completely remove the hover effect for all skins - with one(or more) simple command?

Peter
Telerik team
 answered on 15 Sep 2009
1 answer
120 views
Hi Telerik-Community

We have built an asynchronous implementation of SharePoint's document library web part using the Telerik ASP.NET AJAX components to avoid all the unnecessary postbacks (besides eleminating other issues). The newly created web part works fine, but as soon as I add it to a web part zone on a page, I get JavaScript errors caused by the functions handling the onMouseOver and onMouseOut events for the <SharePoint:AspMenu>. This happens even with the default master page and a common page layout. Are there any known issues on this? Does anybody have any hints what might have gone wrong and how to fix it?

Kind regards,
Thomas

Tom
Top achievements
Rank 1
 answered on 15 Sep 2009
5 answers
164 views
Hi,
I'm using the example you have..
"Create an AJAX-enabled Sharepoint WEbPart tht uses RadControls"
http://www.telerik.com/help/aspnet-ajax/create-ajax-enabled-sharepoint-webpart-radcontrols.html

... and it is not recognizing Telerick Web UI.

AJAX is installed and configured on the MOSS.
RadControls have been deployed to the SharePoint Server.

I'm following the instructions for VS2008.  Using Team Edition.
I'm also converting this to VB which isn't the issue.

When I tried to create the Rad ScriptManager it did not recognize it. Smart Type or otherwise.
Tools have been registered as well.


Is there something missing to this example that you have given?
I'm not seeing anything, but the creation of the webpart in the example, so how is it recognizing the Telerik UI.
Webconfig has http handlers, etc... as they should.

I have what you see on this page except it is in VB and again that isn't the issue.
When I try to declare RadTree or RadScriptManager they are not being recognized.

Thanks!

Thanks!
Veselin Vasilev
Telerik team
 answered on 15 Sep 2009
1 answer
142 views

I have some code that has been working for a while, where I do stuff mostly on the client side (drag drop/delete/edit).  I process the client transactions saved in the ClientChanges collection on the server when a Save button is clicked   I had a need to add code to a context menu to allow adding a child to a selected node.  I specifically needed to have the node show up in edit mode right away for the user to add the node text.  I couldn't get this to work on the client side, so I saw a server side sample on your website that does exactly what I needed  (right click on node and select 'new folder' in context menu  http://demos.telerik.com/aspnet-ajax/treeview/examples/functionality/contextmenu/defaultcs.aspx). 

So I added the onContextMenuItemClick server event to the .aspx  (line 3 below) 

<telerik:RadTreeView ID="tvwCategory" runat="server" EnableDragAndDrop="true" EnableDragAndDropBetweenNodes="true" AllowNodeEditing="true" OnClientNodeDropping="onNodeDropping"  OnClientContextMenuItemClicked="onClientContextMenuItemClicked" 
  OnClientNodeEdited="onClientNodeEdited"  onprerender="tvwCategory_PreRender"   
  oncontextmenuitemclick="tvwCategory_ContextMenuItemClick"

And I of course add the corresponding code to the .aspx.cs for this method just as in the example.  This works great.  But now my code that processes client side changes for Drag and Drop is not working any more.  The client side delete and edit transactions still appear correctly in the ClientChanges collection, but transactions related to Drag and Drop are not there anymore.  If I remove the server side onContextMenuItemClick event code from the .aspx and .aspx.cs, then the Drag and Drop code works again!

What is happening here?  How to fix/ work around it?  I am using version 2008.3.1125.20
Yana
Telerik team
 answered on 15 Sep 2009
2 answers
87 views
I have placed Checkboxes inside radcombo. I DONT want to close the radcombo upon selecting one checkbox inside that.

I want to close radcombo once I move out of radcombo, or/and when I click somewhere outside on the form.

How to handle this?

Note: The Radcombo I am using for Radgrid filtering and its not directly available on the form.

I copied StopPropagation from link below and attached to onclick for checkbox
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/templates/defaultcs.aspx



Cb.Attributes.Add("onClick", "StopPropagation(event)")

and then I created panel dynamically (which renders DIV) and attached

pnl.Attributes.Add("onClick", "StopPropagation(event)")

Note: I am generating combox and checkboxes from codebehind
Sunny
Top achievements
Rank 1
 answered on 15 Sep 2009
2 answers
302 views
Sample code (truncated)

Public Class CustomerCollection
    Inherits List(Of Customer)

End Class

ASPX.VB

custCollection = GetCustomerList()

'custCollection is nothing in my case
RadGrid1.DataSource = custCollection
RadGrid1.DataBind()

and RadGrid is not showing "NoMasterRecordsText"
Sunny
Top achievements
Rank 1
 answered on 15 Sep 2009
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?