Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
87 views
I have a form that has the following workflow.

1. user fills out form, including optionally uploading a file
2. the information gets saved to the database
3. using the ID of the entry, a new folder is created with that ID number
4. the file is uploaded to that folder
5. the user is redirected to another page

I can't seem to place the file uploading process in the right place.  Can someone point me in the right direction of the method to use?  Should I move the files in the button click action? Page load? onFileUpload?  
Jayesh Goyani
Top achievements
Rank 2
 answered on 08 Jul 2013
6 answers
220 views
Hi, I'm trying to reduce the initial load of my Hierarchical grid.  Right now it is about 180kb, I thought if I could create the nested grid on the client when it is needed the initial page load would be small.

I'm using this approach

http://blogs.telerik.com/vladimirenchev/Posts/08-09-09/How_To_Telerik_RadGrid_Master_Detail_client-side_data-binding_using_LINQ_to_SQL_and_WebService.aspx?ReturnURL=%2fvladimirenchev%2fPosts.aspx

Basically I'm using two web services on the client to load my master grid and the nested grid.

Thanks
Chris
Maria Ilieva
Telerik team
 answered on 08 Jul 2013
1 answer
67 views
Hello,

I'm trying to implement some restrictions on dragging and dropping appointments on the scheduler and it looks like the only events to do this are client-side events. How would I access resource values, such as a username to make sure the user is moving his/her own appointment? Would I be able to get the start/end times of the appointment and be able to access the collection of scheduler appointments in JavaScript to make sure they don't overlap?

Thanks,
Matt
Plamen
Telerik team
 answered on 08 Jul 2013
3 answers
38 views
I'm utilizing the SearchBox on a mobile-centric site, and during my testing I've noticed inconsistencies with the search image/button either being mis-aligned or disappearing when switching the phone from portrait to landscape mode (or vice versa).

The search button is properly aligned after initial load in either orientation.  When switching device orientation, the image will either show in the middle of the SearchBox or disappear altogether (seems it might be aligned to the right of the box, but can't be certain).  Reloading the page in the new orientation puts the image back in the proper place.  Perhaps a CSS issue?

I'm using a Galaxy S3 for testing, Android 4.1.1 with the default browser.  I'm not customizing the SearchBox at all, using MetroTouch skin.
Plamen
Telerik team
 answered on 08 Jul 2013
8 answers
270 views
I have my grid working nicely with x and y values as I want - I just want to add a label on the Y axis to signify what kind of data it is - for example say the graph showed money id like a y axis of £, if the y axis was showing temperature data id like to show centigrade.
Note this label im talking about isnt the actual y axis just a textual label to show what the values relate to.

Cheers
Gregor
Peshito
Telerik team
 answered on 08 Jul 2013
2 answers
109 views
Hi,
I have website where people are able to drag and drop custom WebUserControl on a Radgrid. I'm using jQuery-ui to do that but the problem is when i have too much row on my grid, the draggable animation is slow and the control is not moving with the cursor. He teleports to the cursor when we stop moving.

Is there a way to set the Grid's cells "droppable" on the server-side ?

The css class "drag" is on each WebUserControl.
The css class "drop2" is on the <ItemStyle> markup for each columns except the first column.

Javascript :
jQuery.noConflict();
                 
                function pageLoad(sender, args) {
                    jQuery(document).ready(function ($) {
 
                        var title;
                        var col, row, preCol, preRow;
 
                        // set the element draggable (WebUserControl)
                        $(".drag").draggable({
                            drag: function (event, ui) {
                                title = this.title;
                            }
                        });
 
                        // set the element droppable (each cells of RadGrid but not on the first column
                        $(".drop2").droppable({
                            drop: function (event, ui) {
                                col = $(this).parent().children().index($(this));
                                row = $(this).parent().parent().children().index($(this).parent());
                                dropped();
                                alert('Ligne: ' + row + ', Colonne: ' + col);
                            }
                        });
 
                        // AjaxRequest with cell indexes and control's id <== title property
                        function dropped() {
                            $find('<%= RadAjaxManager1.ClientID%>').ajaxRequest("Drop;" + title + ";" + col + ";" + row);
                        }
                    });
                }
 

Code-behind :
public partial class WebForm2 : System.Web.UI.Page
    {       
        protected void Page_Load(object sender, EventArgs e)
        {          
            // Create a List of half day for the next 3 months
            List<string> Montableau = new List<string>();
            DateTime monHeure = DateTime.Now.AddDays(-1).AddHours(-DateTime.Now.Hour).AddMinutes(-DateTime.Now.Minute).AddSeconds(-DateTime.Now.Second).AddMilliseconds(-DateTime.Now.Millisecond);
            while (monHeure < DateTime.Now.AddMonths(3))
            {
                Montableau.Add(monHeure.ToShortDateString() + " " + monHeure.ToShortTimeString());
                monHeure = monHeure.AddHours(12);
            }
 
            RadGrid1.DataSource = Montableau;
            RadGrid1.DataBind();
 
            for (int i = 0; i < Montableau.Count; i++)
            {
                RadGrid1.Items[i].Cells[2].Text = Montableau[i];
                RadGrid1.Items[i].Cells[3].Text = "";
                RadGrid1.Items[i].Cells[4].Text = "";
                RadGrid1.Items[i].Cells[5].Text = "";
            }
 
            // Creating 2 WebUserControl dynamically
            WebUserControl1 ctrl = (WebUserControl1)LoadControl("~/WebUserControl1.ascx");
            ctrl.idControl = "wuc9";
            ctrl.ID = "wuc9";
            ctrl.numeroAffaire = "9";
            ctrl.leSite = "Test";
            ctrl.idControl = ctrl.ID;
            ctrl.couleurFond = Color.Aqua;
            Panel2.Controls.Add(ctrl);
 
            WebUserControl1 ctrl2 = (WebUserControl1)LoadControl("~/WebUserControl1.ascx");
            ctrl2.idControl = "wuc10";
            ctrl2.ID = "wuc10";
            ctrl2.numeroAffaire = "10";
            ctrl2.leSite = "Test";
            ctrl2.idControl = ctrl2.ID;
            ctrl2.couleurFond = Color.Lime;
            Panel2.Controls.Add(ctrl2);
        }           
 
        protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
        {
            if (e.Argument.StartsWith("Drop"))
            {
                string[] mesArg = e.Argument.Split(';');
                 
                // Search the control with the id (title attributes)
                WebUserControl1 user = this.FindControl(mesArg[1]) as WebUserControl1;
 
                // Search the RadGrid
                RadGrid rg = (RadGrid)FindControl("RadGrid1");
                if (rg != null)
                {
                    // Add control in the correct cell
                    if (rg.Items[int.Parse(mesArg[3])].Cells[int.Parse(mesArg[2]) + 2].Controls.Count == 0)
                    {
                        rg.Items[int.Parse(mesArg[3])].Cells[int.Parse(mesArg[2]) + 2].Controls.Add(user);                       
                    }
                    else
                    {
                        RadAjaxManager1.Alert("Cette case contient deja un control");
                    }
                }
                UpdatePanel1.Update();
            }
        }
    }

Thanks !
samuel
Top achievements
Rank 1
 answered on 08 Jul 2013
1 answer
118 views
I am looking to use the filter control as a tool to let my clients easily generate there own SQL where conditions.  Please realize though that I am using this control alone and do not have/want it tied to a grid or any other control. However I have some conditions that at the moment doesn't seem to work to well with the control.  

1) I already store in a SQL table all the Fields and Operators a client can select upon.  However the radFilter does not appear to let you define the operators for a specific field on the server side.  So for example I would be adding all my fields on PageLoad or PreInit and maybe I don't want a specific field like "Last Name" to have "IsNull" as a filter option but another field may allow it.
* Doing this only in the client side like all suggestions seem to direct you is really a hack and leads to unclean code especially when your not blanket-ally removing an operator across all fields.

2) I would like to make my own field but am wondering if the filter control can handle it.  Say for example someone wanted to query for "Transaction Amount" > 100 and "Transaction Date" between 1/1/2012 and 3/3/2012.  To handle this properly you would have to make a unique operator(s) that would let you set the fields shown.  You may also want to do something like "Transaction Amount" between 100 and 1000 and "Transaction Date" between 1/1/2012 and 3/3/2012.  Then there would be possibility of 4 values and 2 operator conditions.
* Please realize that what I am saying is different then 2 different filter items.  Because I am specifically saying i want to find people with a transaction amount greater then 100 between the specific dates.  If you used what the Sqlprovider gives you actually end up with people who have some transaction > 100 unrelated to the provided supplied date range.  I realize that this requires parsing on my part and wouldn't rely on the SqlProvider for anything.

3) There appears to be no built in method to get a simple representation of the filters other then radFilter.RootGroup.Expressions but you have to parse all the fields out yourself?
* Has telerik given any thought to a XmlProvider so that you can get a representation of the filter fields, operators, and values as XML?  This would allow others to take that XML and interpret it how they choose.

4) Similar to number 3 the Save/Load functionality should support an xml string versus base64 encoded string.  This would allow you to interpret the xml how you choose and possibly review created selects directly in sql.
Antonio Stoilkov
Telerik team
 answered on 08 Jul 2013
1 answer
157 views
Hi guys.I am creating tree view from some of my class object dynamically.
What i need to do is drag(just drag not remove) the leaf node into the rich text editor text.



I have tried to create the nodetemplate but not succcessful( other wise just add the node template in the leaf node with label)
Following is the code of making the treeview node.

TreeView1.Nodes.Clear();

            DocumentTemaplateCompiledDto obj = DocumentTemaplateCompiledBll.GetInstance.GetDocumentTemaplateCompiledByTemplateId(Int32.Parse(ddlTemplates.SelectedValue));


if (obj.LstSections != null && obj.LstSections.Count > 0)
            {
                foreach (var objSection in obj.LstSections)
                {
                    var tNode = new RadTreeNode(objSection.SectionName);                  
 
                    if (obj.LstSimpleFields != null && obj.LstSimpleFields.Any(h => h.FkDocumentTemplateSectionId == objSection.DocumentTemplateSectionId))
                    {
                        var tNodeChildSimpleFields = new RadTreeNode("Simple_fields_Control");
 
                        foreach (var objSimplefield in obj.LstSimpleFields.FindAll(h => h.FkDocumentTemplateSectionId == objSection.DocumentTemplateSectionId))
                        {
                            var tNodeChildGridTextEntry = new RadTreeNode(objSimplefield.FieldName);
                            tNodeChildGridTextEntry.Nodes.Add(new RadTreeNode
                            {
                                Text = objSimplefield.FieldCode,//these are the leaf node
                                AllowEdit = true,//this I have done as a last possible option
                                AllowDrop = true,//this I have done as a last possible option
                                AllowDrag = true//this I have done as a last possible option
                            });
                            tNodeChildSimpleFields.Nodes.Add(tNodeChildGridTextEntry);
                        }
                        tNode.Nodes.Add(tNodeChildSimpleFields);
                    }
                    TreeView1.Nodes.Add(tNode);
                }
            }
             
            


<telerik:RadEditor ContentAreaMode="Div" runat="server" ID="RadEditor1" Height="515"
            Width="700" Visible="True">
            </telerik:RadEditor>


Please suggest me how can i achieve my desired reuslt.
Any help guys?
kamii47
Top achievements
Rank 1
 answered on 08 Jul 2013
1 answer
164 views
Hi,

can anyone please help, I am in the process of converting one of our working basic repeaters into a RadListView.

On the OnItemDataBound event I want to fire some code to format items in the itemtemplate using one of our business objects "tblVehicle" with the following code:
protected void uiRptCars_ItemDataBound(object sender, Telerik.Web.UI.RadListViewItemEventArgs e)
    {
        if (e.Item is Telerik.Web.UI.RadListViewDataItem)
        {
            tblVehicle item = ((tblVehicle)e.Item).DataItem;
            string name = string.Format("{0} {1} {2}", item.RegDate.Year, item.Make, item.Model);
            string url = string.Format("{0} {1} {2}", item.Make, item.Model, item.RegDate.Year).ToLower().Replace(" ", "-").Replace("/", "~");
            Image uiImgCar = (Image)e.Item.FindControl("uiImgCar");
            Literal uiLitTitle = (Literal)e.Item.FindControl("uiLitTitle");
            Literal uiLitColour = (Literal)e.Item.FindControl("uiLitColour");
            Literal uiLitFuel = (Literal)e.Item.FindControl("uiLitFuel");
            Literal uiLitTrans = (Literal)e.Item.FindControl("uiLitTrans");
            Literal uiLitEng = (Literal)e.Item.FindControl("uiLitEng");
            uiLitTitle.Text = string.Format("<h3><a href='/cars-for-breaking/{0}/{1}'>{2}</a></h3>", item.VehicleId, url, name);
            uiLitColour.Text = item.Colour;
            uiLitFuel.Text = item.FuelType;
            uiLitTrans.Text = item.Transmission;
            uiLitEng.Text = item.EngineCode;
            uiImgCar.AlternateText = name;
}
}

However, at the line

tblVehicle item = ((tblVehicle)e.Item).DataItem;
I'm getting the following error: Cannot convert type 'Telerik.Web.UI.RadListViewItem' to 'tblVehicle'
I'm sure there is a simple answer to this as everything worked fine under a straightforward repeater control.
Any help would be greatly appreciated.

Regards
Dale


Marin
Telerik team
 answered on 08 Jul 2013
6 answers
203 views
Hello Everyone,

i want to create one drop-down menu like shown in image on all row of RadGrid where i can click on individual link to perform task like edit,delete etc,


can anyone have idea about this?

Thanks
Viktor Tachev
Telerik team
 answered on 08 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?