Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
70 views
i'm wondering if the user needs to have a working databind, or if the example can work on manually inputted data?

also i always get the error connectionstring is empty or not working

any help is appreciated thanks
Gelo
Top achievements
Rank 1
 asked on 16 May 2012
4 answers
121 views
I have a master/detail radgrid. The detail table's EditMode is set to popup, and it has an EditFormTemplate. I would like to be able to initiate the detail table's insert popup from a button in the master. I tried trapping the button command in code behind and doing: e.Item.OwnerTableView.DetailTables[0].InsertItem(); but that doesn't seem to work.

The insert popup works fine from a standard command button on the detail table's command strip, but I would like to do it from the master button so I can remove the detail command strip altogether.

Is there any way to do that?

Thanks

Ross Crawford
Lucania
Top achievements
Rank 1
 answered on 16 May 2012
3 answers
92 views
Hello,

I've spent the past few days trying to subclass Appointment to add additional data properties to it, but to no avail.  (We need to add a dynamic list of string int pairs to the Appointment, which, since they are dynamic, can't be done with the standard declarative attributes set).

So, on my subclass, I overrode Clone, the deserialization constructor and GetObjectData, LoadViewState, and SaveViewState, and created an appropriate AppointmentFactory for the scheduler to use.  However, my additional data values were never making it back to the Insert or Update call on my provider.

Having a look at the code using Reflector, I see that my values are likely getting lost during the internal call to LoadFromDictionary.  There are no virtual functions there for me to inject my data values into the load, so they are never getting restored.

So, just for my own sanity, I wanted to confirm that yes, given the way Scheduler is currently written, subclassing Appointment in this way is impossible, and it's okay to stop trying to make this work.  :)

I am going to fall back and use one of the standard attributes as a delimited string of the values, but I was hoping for the more elegant solution.

Best regards,
Eve
Jeff
Top achievements
Rank 1
 answered on 16 May 2012
2 answers
201 views

I fill a treeView with Type object (MyCollection : List<MyType>, IHierarchicalEnumerable)
and work perfect but now I need set the datasource of a treeView inside a combox:

<telerik:RadComboBox ID="RadComboBox1" runat="server">
<ItemTemplate>
<telerik:RadTreeView ID="RadTreeView2" runat="server" >
</telerik:RadTreeView>
</ItemTemplate>
</telerik:RadComboBox>

 

How I do that?

I been try this:
var tree = new RadTreeView {DataSource = _categoryCollection};
            tree.DataBind();
            RadComboBox1.Controls.Add(tree);
            RadComboBox1.DataBind();

The treview fill ok , But combobox does not show anything. 

I need some like this

http://demos.telerik.com/aspnet-ajax/treeview/examples/functionality/treeviewcombobox/defaultcs.aspx

 

 

Oscar
Top achievements
Rank 1
 answered on 15 May 2012
2 answers
112 views
Hi Telerik, 

When I use a RadUpload w/ ControlObjectsVisibility='None' I get (from left to right): a textbox, a button that says "Browse...", another textbox and then a button that says "Select."  

I would like to get rid of the last two controls, the extra textbox & select button.  I've seen other similar posts, which prescribed adding a RadStyleSheetManager and a RadScriptManager, but neither solution seems to work.  Can you possibly provide any other insight or suggestions?  Thanks very much.

<form id="form1" runat="server">
<telerik:RadScriptManager runat="server" ID="escrowDocumentEditRadScriptManager" />
<div>
<telerik:RadStyleSheetManager runat="server" ID="RadStyleSheetManager1" ></telerik:RadStyleSheetManager>
    <telerik:RadUpload ID="escrowDocumentRadUpload" runat="server" AllowedFileExtensions="pdf" EnableEmbeddedSkins="false" Skin="Standard" InitialFileInputsCount="1" MaxFileInputsCount="1" ControlObjectsVisibility="None" />

Greg
Top achievements
Rank 1
 answered on 15 May 2012
6 answers
259 views

 At my organization we have been using the Rad Grid and it has been working well for us. At the moment we're only loading a few hundred records at most into the grid, and using the paging functionality to limit 20 results per page. The performance is good.

  A coworker shared a concern about potential performance issues if we have to load a very large data set into the grid. Even if the grid can handle it ok the query used to retrieve the data may take a long time. The suggestion to load the data per visible page was mentioned.  From what I can discern from the available documentation the grid requires that all up front. That is to say that it doesn't support loading only a subset of the data per page, or set of pages. However, I would just like to be able to confirm that is the case and that I'm not missing something.

Thanks.
Attila
Top achievements
Rank 1
 answered on 15 May 2012
1 answer
810 views
Any help ?
Hi ,
I have a radgrid with 4 columns, where i have to edit 2nd column highlighted below. What are things i have to achieve this ?
With below code last row 2nd column of grid is in editable mode and entire row is getting highlighted..  what are things i have to do for editing all rows and only 2 column.

Please Suggest   .

   <telerik:RadGrid ID="rdGrdMenu" runat="server" AutoGenerateColumns="false" AllowFilteringByColumn="true"
                Skin="Office2007" GridLines="Both" OnItemDataBound="rdGrdMenu_ItemDataBound" >
                <MasterTableView EditMode="InPlace">
                    <Columns>
                        <telerik:GridBoundColumn HeaderText="Group Level" UniqueName="prdlvl" DataField="prdlvl"
                            Visible="true" ReadOnly="true">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Description" UniqueName="prdlvldsc" DataField="prdlvldsc"
                            Visible="true" >
                        </telerik:GridBoundColumn>

                        <telerik:GridTemplateColumn HeaderText="Budget" UniqueName="budflg" DataField="budflg">
                            <ItemTemplate>
                                <cc1:AFSAt_CodeDropDown ID="drpDownBdgt" runat="server" AtCodeType="000006" Width="100%">
                                </cc1:AFSAt_CodeDropDown>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Status" UniqueName="Status" DataField="codsts">
                            <ItemTemplate>
                                <cc1:AFSAt_CodeDropDown ID="drpDownStatus" runat="server" AtCodeType="000001" Width="100%">
                                </cc1:AFSAt_CodeDropDown>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

Codebehind :
     protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
        //to set the Grid always in edit mode
        foreach (GridDataItem item in rdGrdMenu.MasterTableView.Items)
        {
            item.Edit = true;
        }
        rdGrdMenu.Rebind();
    }

   Regards,
Akki    
Richard
Top achievements
Rank 1
 answered on 15 May 2012
1 answer
115 views
Hi,

I am testing out the Drag/Drop capabilities of the RadGrid (dragging from one grid to another), and I've come across a problem. It works great when the grid I'm dragging from has more than one row, but if there's one row I get the following JScript error thrown:

Microsoft JScript runtime error: Unable to get value of the property 'rows': object is null or undefined

Here's my ASPX markup:

    <script type="text/javascript">
 
        function OnClientUpdated(sender, args) {
            var message = "Update (check) was done!";
            var newMsgs = sender.get_value();
            if (newMsgs != 0) {
                sender.show();
                message += (newMsgs == 1) ? (" There is 1 new message!") : (" There are " + newMsgs + " new messages!");
            }
            else {
                message += " There are no new messages!";
            }
        }
         
    </script>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadScriptBlock runat="server" ID="scriptBlock">
 
        <script type="text/javascript">
                <!--
            function onRowDropping(sender, args) {
                if (sender.get_id() == "<%=RadGrid1.ClientID %>") {
                    var node = args.get_destinationHtmlElement();
                    if (!isChildOf('<%=RadGrid2.ClientID %>', node) && !isChildOf('<%=RadGrid1.ClientID %>', node)) {
                        args.set_cancel(true);
                    }
                }
                else {
                    var node = args.get_destinationHtmlElement();
                    if (!isChildOf('trashCan', node)) {
                        args.set_cancel(true);
                    }
                    else {
                        if (confirm("Are you sure you want to delete this order?"))
                            args.set_destinationHtmlElement($get('trashCan'));
                        else
                            args.set_cancel(true);
                    }
                }
            }
 
            function isChildOf(parentId, element) {
                while (element) {
                    if (element.id && element.id.indexOf(parentId) > -1) {
                        return true;
                    }
                    element = element.parentNode;
                }
                return false;
            }
                    -->
        </script>
 
    </telerik:RadScriptBlock>
     <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
         <telerik:RadSplitter ID="RadSplitter1" Width="100%" runat="server">
         <telerik:RadPane runat="server">
   <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="true"
                 onneeddatasource="RadGrid1_NeedDataSource" onrowdrop="RadGrid1_RowDrop">
   <MasterTableView AllowCustomSorting="true" AllowPaging="true" DataKeyNames="ID" AllowSorting="true" PageSize="20">
   
   </MasterTableView>
     <ClientSettings AllowRowsDragDrop="True" AllowColumnsReorder="true" ReorderColumnsOnClient="true">
                    <Resizing AllowColumnResize="true" />
                    <Selecting AllowRowSelect="True" EnableDragToSelectRows="false"/>
                    <Scrolling AllowScroll="true" UseStaticHeaders="true"/>
                          <ClientEvents OnRowDropping="onRowDropping" />
                </ClientSettings>
</telerik:RadGrid>     
         </telerik:RadPane>
         <telerik:RadSplitBar runat="server"></telerik:RadSplitBar>
         <telerik:RadPane runat="server">
   <telerik:RadGrid ID="RadGrid2" runat="server" AllowFilteringByColumn="true"
                 onneeddatasource="RadGrid2_NeedDataSource" onrowdrop="RadGrid2_RowDrop">
   <MasterTableView AllowCustomSorting="true" DataKeyNames="ID" AllowPaging="true" AllowSorting="true" PageSize="20">
   
   </MasterTableView>
     <ClientSettings AllowRowsDragDrop="True" AllowColumnsReorder="true" ReorderColumnsOnClient="true">
                    <Resizing AllowColumnResize="true" />
                             <ClientEvents OnRowDropping="onRowDropping" />
 
                    <Selecting AllowRowSelect="True" EnableDragToSelectRows="false"/>
                    <Scrolling AllowScroll="true" UseStaticHeaders="true"/>
                </ClientSettings>
</telerik:RadGrid>     
          
         </telerik:RadPane>
         
         </telerik:RadSplitter>
    
</telerik:RadAjaxPanel>
 
  <telerik:RadNotification ID="RadNotification1" runat="server" LoadContentOn="TimeInterval"
        Width="300" Animation="Fade" EnableRoundedCorners="true" EnableShadow="true"
        OnClientUpdated="OnClientUpdated" Title="Notifications" OffsetX="-20" OffsetY="-20"
        TitleIcon="none" UpdateInterval="10000" AutoCloseDelay="1500" OnCallbackUpdate="OnCallbackUpdate">
        <ContentTemplate>
            <asp:Literal ID="lbl" runat="server"></asp:Literal>
        </ContentTemplate>
    </telerik:RadNotification>

Here's my code behind:

public IList<Delivery> _Deliveries
        {
            get return (List<Delivery>)Session["Deliveries"]; }
            set { Session["Deliveries"] = value; }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                _Deliveries = new List<Delivery>();
                _Deliveries.Add(new Delivery { ID = 1, Assigned = false, Customer = "Micross", TripDate = DateTime.Today });
                _Deliveries.Add(new Delivery { ID = 2, Assigned = false, Customer = "Test", TripDate = DateTime.Today });
                _Deliveries.Add(new Delivery { ID = 3, Assigned = false, Customer = "Micross3", TripDate = DateTime.Today });
                _Deliveries.Add(new Delivery { ID = 4, Assigned = false, Customer = "Test3", TripDate = DateTime.Today });
 
                RadGrid1.DataBind();
            }
        }
 
        private void BindMain()
        {
            RadGrid1.DataBind();
        }
 
        private void BindSecond()
        {
            RadGrid2.DataSource = _Deliveries.Where(a => a.Assigned == true);
            RadGrid2.DataBind();
        }
 
 
 
        protected void OnCallbackUpdate(object sender, RadNotificationEventArgs e)
        {
            int newMsgs = DateTime.Now.Second % 10;
            if (newMsgs == 5 || newMsgs == 7 || newMsgs == 8 || newMsgs == 9) newMsgs = 0;
            lbl.Text = String.Concat(new object[] { "You have ", newMsgs, " new invoices to process!" });
            RadNotification1.Value = newMsgs.ToString();
        }
 
        protected void RadGrid2_RowDrop(object sender, GridDragDropEventArgs e)
        {
                foreach (GridDataItem draggedItem in e.DraggedItems)
                {
                    var tmpOrder = _Deliveries.Where(a => a.ID == (long)draggedItem.GetDataKeyValue("ID")).Single();
                    tmpOrder.Assigned = false;
                }
 
                RadGrid1.Rebind();
                RadGrid2.Rebind();
           
        }
 
        protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            RadGrid1.DataSource = _Deliveries.Where(a => a.Assigned == false);
 
        }
 
        protected void RadGrid2_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            RadGrid2.DataSource = _Deliveries.Where(a => a.Assigned == true);
 
        }
 
        protected void RadGrid1_RowDrop(object sender, GridDragDropEventArgs e)
        {
 
                foreach (GridDataItem draggedItem in e.DraggedItems)
                {
                    var tmpOrder = _Deliveries.Where(a => a.ID == (long)draggedItem.GetDataKeyValue("ID")).Single();
                    tmpOrder.Assigned = true;
                }
                RadGrid1.Rebind();
                RadGrid2.Rebind();
          
        }

Thanks! 
Richard
Top achievements
Rank 1
 answered on 15 May 2012
5 answers
403 views
Hi all

I have a very wide grid, I am using Header Context Menu to Hide/Show the columns then I save the settings of the grid using GridSettingsPersister mentioned in the help.

My problem is that when I hide columns, save settings, and on the next time I load the settings and apply it on the grid, then I show some hidden columns(using header context menu, the grid does not resize, instead, with width of the other columns decreased. I used: TableLayout="Fixed", but It did not work. The width of the grid and master MasterTableView is calculated on GridSettingsPersister as follows:

            double totalWidth = 0; 
 
            foreach (GridColumn column in gridInstance.MasterTableView.Columns) 
            { 
                Triplet triplet = new Triplet(); 
                
                    triplet = dict[column.UniqueName]; 
                    Unit width = (Unit)triplet.Second; 
                    column.OrderIndex = (int)triplet.First; 
                    column.HeaderStyle.Width = width; 
                    column.Display = (bool)triplet.Third; 
 
                    if((bool)triplet.Third) 
                        totalWidth += width.Value;                    
                 
               
            } 
            gridInstance.Width = Unit.Percentage(totalWidth); 
            gridInstance.MasterTableView.Width = Unit.Percentage(totalWidth); 

Settings the width to 100% does not fix the issue, also leaving it empty.

Nilar
Top achievements
Rank 1
 answered on 15 May 2012
1 answer
348 views

I have two RadGrids, which are on different page(one is in base page another one in Overlay). Both are prepopulating and in first grid i have checkboxes for each row.


Now i want to add a new row in my second grid , based on the row selection of first grid means which rows checkboxes are checked.

Can anyone send me any sample code to do that. please Suggest.

Thanks.



Richard
Top achievements
Rank 1
 answered on 15 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?