Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
964 views
Hi,
i am having treeview, i want to get value of selected child node in rad treeview?
Without using javascript.
Thanks
Ivan Danchev
Telerik team
 answered on 20 Jan 2015
1 answer
96 views
I follow several samples and nothing seems wrong with my code, but I still receiving a NULL value error when I try to insert a value. The product_id parameter is not binded and pass onto the INSERT SQL statement. Here is my code

ASP.NET
<
telerik:RadGrid ID="RadGrid1" runat="server"
            AllowAutomaticDeletes="True"
            AllowAutomaticInserts="True"
            AllowAutomaticUpdates="True"
            AllowFilteringByColumn="True"
            AllowPaging="True"
            AllowSorting="True"
            DataSourceID="SqlDataSource1"
            OnItemDataBound="RadGrid1_ItemDataBound"
            EnableLinqExpressions ="false">
 
            <MasterTableView AutoGenerateColumns="False" DataSourceID="SqlDataSource1" CommandItemDisplay="Top" DataKeyNames="product_name">
     
                <EditFormSettings EditFormType="Template">
                            <FormTemplate>
                    
                                            <telerik:RadAutoCompleteBox ID="radAutoCompleteBox1" runat="server"
                                                DataSourceID="SqlDataSource6"
                                                DataTextField="product_name"
                                                DataValueField="product_id"
                                                InputType="Text"
                                                Delimiter=" "
                                                SelectionMode="Single"
                                                Width="300"
                                                EmptyMessage="Type product name...">
                                            </telerik:RadAutoCompleteBox>
  
                                  
                            </FormTemplate>
                        </EditFormSettings>
            </MasterTableView>
        </telerik:RadGrid>
VB

Protected
Sub RadGrid1_ItemDataBound(sender As Object, e As GridItemEventArgs)
        If e.Item.IsInEditMode Then
            Dim item As GridEditableItem = DirectCast(e.Item, GridEditableItem)
            If Not (TypeOf e.Item Is IGridInsertItem) Then
                Dim radAutoCompleteBox1 As RadAutoCompleteBox = DirectCast(item.FindControl("radAutoCompleteBox1"), RadAutoCompleteBox)
                radAutoCompleteBox1.Entries.Add(New AutoCompleteBoxEntry(item("product_name").Text, item("product_name").Text))
            End If
        End If
    End Sub
Boyan Dimitrov
Telerik team
 answered on 20 Jan 2015
4 answers
120 views
I have not been able to get this to work. Mainly, I've read this and tried to emulate it: https://demos.telerik.com/aspnet-ajax/persistence-framework/examples/custom-storage-provider/defaultcs.aspx, but haven't gotten this to work.

The problem I'm having is the "state" the StorageProvider tries to store is this:

"<?xml version="1.0"?>
<ArrayOfRadControlState xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <RadControlState>
    <ControlSettings />
    <UniqueId>Telerik.Web.UI_PersistanceManager_CustomSettings</UniqueId>
  </RadControlState>
</ArrayOfRadControlState>"

It does not seem to grab the checkbox data at all! How do I tell it to?


Hristo Valyavicharski
Telerik team
 answered on 20 Jan 2015
1 answer
52 views
I placed radgrid inside radwindow in user control page.
The Page will be postback whenever radgrid itemcommand event occurs.

How to avoid postback in radwindow on radgrid command events?

Marin Bratanov
Telerik team
 answered on 20 Jan 2015
1 answer
81 views
How can I limit the editable cols on a popup or inplace edit?
Eyup
Telerik team
 answered on 20 Jan 2015
5 answers
135 views
Hello.
I'm using timelinewiew with resources (people) to develop a planning application. Purpose is to have "events" not assigned to a resource and by moving the event and dropping it on a resource's timeline assign it to that resource. The setup works fine, display of both events and resources works. The events are actually two classes of business objects that both derive from one class that exposes the Appointment attributes (start, end, subject etc.). Both types of events are supplied from database in generic lists. Resources too.

I have implemented the server-side method myScheduler_AppointmentUpdated with logic to update an event if it is dragged from one resource's timeline to another (and then setting the schedulers DataSource to an updated list of events). This seems to work, as at least sometimes when I move an event from one resource to another, the AppointmentUpdate event is fired. But, the event does not fire every time. I have tried to find a pattern for when the event fires and when not, but it seems random.

Not using any client-side stuff at all.

It seems I'm missing something basic here, which is probably correct as I'm a Telerik/scheduler noob :)

Anyone have any ideas?

Attached a screenshot of the timeline layout.
This is my scheduler:
<telerik:RadScheduler ID="schAbsences"
        runat="server"
        HoursPanelTimeFormat="HH:mm"
        SelectedView="TimelineView"
        ShowViewTabs="false"
        ShowResourceHeaders="true"
        TimelineView-EnableExactTimeRendering="true" 
        TimelineView-ShowDateHeaders="true"   
        OnAppointmentDataBound ="schAbsences_AppointmentDataBound"
        OnAppointmentDelete="schAbsences_AppointmentDelete"
        OnAppointmentUpdate="schAbsences_AppointmentUpdate"
        ColumnHeaderDateFormat="h:mm"
        FirstDayOfWeek="Monday"
        LastDayOfWeek="Sunday"
        ShowAllDayRow="true"
        ShowFooter="true"
        OverflowBehavior="Expand"
        OnNavigationComplete="schAbsences_NavigationComplete">
        <TimelineView NumberOfSlots="24" SlotDuration="01:00:00" TimeLabelSpan="1" ColumnHeaderDateFormat="HH:mm tt" />
    </telerik:RadScheduler>
And this is my code-behind:
Resource-types:
ResourceType rt = new ResourceType();
                rt.Name = "Resources";
                rt.ForeignKeyField = "ResourceId";
                rt.KeyField = "Id";
                rt.TextField = "FullName";
                List<Entities.Resource> blapp = new List<Entities.Resource>();
                blapp.AddRange(DBManager.GetExistingResources());
                Entities.Resource r = new Entities.Resource();
                r.firstName = "Inte";
                r.lastName = "tillsatt";
                r.Id = 0;
                blapp.Insert(0, r);
                rt.DataSource = blapp;
                schAbsences.ResourceTypes.Add(rt);
                DateTime startTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
                schAbsences.SelectedDate = startTime;
                
                schAbsences.TimelineView.GroupBy = "Resources";
                schAbsences.TimelineView.GroupingDirection = GroupingDirection.Vertical;
AppointmentUpdate-method:
protected void schAbsences_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)
        {
            String type = e.Appointment.Attributes["appointmentType"];
            if (type.Equals("Absence"))
            {
                //Do update (use Attributes)
                int origRsId = int.Parse(e.Appointment.Resources[0].Key.ToString());
            }
            else
            {
                int origResId = int.Parse(e.Appointment.Resources[0].Key.ToString());
                int newResId = int.Parse(e.ModifiedAppointment.Resources[0].Key.ToString());
                int appointmentId=int.Parse(e.Appointment.ID.ToString());
                DBManager.UpdateMovedPlacementCompetence(appointmentId, newResId);
                e.Cancel = true;
            }
            List<BDEvent> list = DBManager.GetAllAbsencesAsEvents();
            list.AddRange(DBManager.GetAllPlacementCompetences());
            schAbsences.DataSource = list;
             
        }
Plamen
Telerik team
 answered on 20 Jan 2015
4 answers
120 views
Hi..

I'm using batch edit mode on my rad grid.. I need to run some code after last iteration of the UpdateCommand. http://www.telerik.com/help/aspnet-ajax/grid-batch-editing.html...

How can I test for the last iteration of RadGrid.UpdateCommandName when using batch edit.mode?

             protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
                { 
                      if (e.CommandName == RadGrid.UpdateCommandName)
                      {

                       }
                }
Dave
Top achievements
Rank 1
 answered on 20 Jan 2015
14 answers
439 views
Hi,
I have followed the documentation and googled to find way to how to deploy radgrid in my sharepoint page. But I am unable to do it.....can anyone give me a sample code + a webpart file to just upload it in sharepoint and use it? From this, I could get an idea to how to populate Radgrid from within Sharepoint.
And one thing more, do I need to tell Sharepoint like to make Telerik components being used? Well, I know how to add safe controls in web.config.
vijila
Top achievements
Rank 1
 answered on 20 Jan 2015
2 answers
100 views
Hi,
I have my grid setup like this:               

<Columns>
                <telerik:GridBoundColumn DataField="col1" HeaderText="Col 1" UniqueName="mytxt" />
                <telerik:GridDropDownColumn DataField="col2" UniqueName="mydd" DropDownControlType="RadComboBox"  HeaderText="Col 2" />                                     
</Columns>


Now I have some questions relating to this:

1. Do I need to manually handle the populating of the field for 'view' mode? Unless I use the code below in ItemDataBound then in view mode the dropdown column is empty.           

if (e.Item is GridDataItem)
            {
                GridDataItem item = (GridDataItem)e.Item;
                DataRowView row = (DataRowView)e.Item.DataItem;
                item["mydd"].Text = row["col2"].ToString();
            }


2. Why does the drop down column have no controls, in ItemDataBound:           

if (e.Item is GridEditableItem && e.Item.IsInEditMode)
{
            GridEditableItem item = (GridEditableItem)e.Item; 
             
            //Controls has one control:
            //RadTextBox = (RadTextBox)item["mytxt"].Controls[0]; 
             
            //Controls is empty:
            //RadComboBox com = (RadComboBox)item["mydd"].Controls[0];
 }


3. Is it possible to use a non-datasource-bound combo? so in ItemDataBound I would do something like this:  
         
if (e.Item is GridEditableItem && e.Item.IsInEditMode)
{
            GridEditableItem item = (GridEditableItem)e.Item;
 
            RadComboBox com = (RadComboBox)item["mydd"].Controls[0];
            com.Items.Add(new RadComboxItem("a", "a"));
            com.Items.Add(new RadComboxItem("b", "b"));
 }

Eyup
Telerik team
 answered on 20 Jan 2015
6 answers
693 views
I have 2 div's on my form.

One is Home Address Information and one is Mailing Address Information. Each includes a radcombobox for states.  I also have a checkbox that says "Mail Address same as Home Address" and when the person checks this, I need to copy the Home Address fields (address,city,state) to the Mailing Address fields (address,city,state)  and I want to do this client side of course.

When I use the standard <asp: DropDownList, I can just say this and it works:
$("#<%=ddlMState.ClientID %>").val($("#<%=ddlHState.ClientID %>").val());

This does not work with the Telerik control. Can you help? I would rather use your radcombobox

Thanks!
Nencho
Telerik team
 answered on 20 Jan 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?