Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
145 views

I'm attempting to set a given row to Edit Mode when an item in a row has a specific value. I've tried setting using GridEditableItem editableItem.Edit = true, but it seems like this only works for edit mode EditForms.

 

How do I set row to editmode for InPlace editing?

Michael
Top achievements
Rank 1
 answered on 05 Feb 2018
1 answer
314 views

I have to create RadComboBoxes dynamically in a Repeater.  I'm trying to find a way to set the WebServiceSettings in the code behind.  I found this code that uses JQuery:

function clientLoad(sender) {
    sender.set_webServiceSettings('{"path":"Products.asmx","method":"GetCompanyNames"}');
}

But the service does not return Json so I receive an error.  I create the control in the code behind like this:

            List <ModuleView.JobBO> list = new List<ModuleView.JobBO>();
            switch (moduledatakey)
            {
                case "JOB":
                    list = JobDA.Job_GetList_ByJobNumberContains(DB_Context, mfilter, top, companyId);
                    RadComboBox ddl = new RadComboBox();
                    ddl.ID = "ddlJob";
                    ddl.ItemDataBound += new RadComboBoxItemEventHandler(ddlJob_ItemDataBound);
                    ddl.ItemsRequested += new RadComboBoxItemsRequestedEventHandler(ddlJob_ItemsRequested);
                    ddl.EmptyMessage = "Type to Select...";
                    ddl.EnableLoadOnDemand = true;
                    ddl.EnableTextSelection = true;
                    ddl.DataSource = list;
                    ddl.Text = "";
                    ddl.DataValueField = "JobId";
                    ddl.DataBind();
                    ddl.OnClientLoad = "clientLoad";
                    ddl.DropDownAutoWidth = Telerik.Web.UI.RadComboBoxDropDownAutoWidth.Enabled;
                    ddl.AutoPostBack = true;
                    ddl.EnableViewState = false;
                    ddl.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(qfTicket_cmbJob_SelectedIndexChanged);
                    plc2.Controls.Add(ddl);
                    break;
            }

and use the following to implement the "LoadOnDemand":

        protected void ddlJob_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            string mfilter = e.Text;
            int top = 50;
            Guid? companyId = null;

            List<ModuleView.JobBO> list = new List<ModuleView.JobBO>();
            list = JobDA.Job_GetList_ByJobNumberContains(DB_Context, mfilter, top, companyId);
            ((RadComboBox)sender).DataSource = list;
            ((RadComboBox)sender).DataBind();

        }

This works fine accept the LoadOnDemand is EXTREMELY slow.   I want to use the following web method which we are using on other comboboxes that are NOT created dynamically.

 [WebMethod(EnableSession = true)]
        public RadComboBoxData GetJobs(RadComboBoxContext context)
        {
            //get data
            List<ModuleView.JobBO> lComps = new List<ModuleView.JobBO>();
            COG_ContextDB db_context = UtilityBA.GetAspNetDataContext();
            //company id?
            App_Code_COGS.UI.UIUtilities.GridState oState = App_Code_COGS.UI.UIUtilities.GetGridStateFromSession();
            Guid? gCustomerId = (UtilityBA.IsValidGuid(oState.CustomerId) ? (Guid?)Guid.Parse(oState.CustomerId) : null);
            //get data
            lComps = JobBA.Job_GetList_ByJobNumberContains(db_context, context.Text, 50, gCustomerId);
            if (lComps == null)
            {
                lComps = new List<ModuleView.JobBO>();
            }
            //prep data controls
            RadComboBoxData comboData = new RadComboBoxData();
            List<RadComboBoxItemData> result = new List<RadComboBoxItemData>(context.NumberOfItems);
            //get top N
            try
            {
                int itemsPerRequest = 10;
                int itemOffset = context.NumberOfItems;
                int endOffset = itemOffset + itemsPerRequest;
                if (endOffset > lComps.Count)
                {
                    endOffset = lComps.Count;
                }
                if (endOffset == lComps.Count)
                {
                    comboData.EndOfItems = true;
                }
                else
                {
                    comboData.EndOfItems = false;
                }
                result = new List<RadComboBoxItemData>(endOffset - itemOffset);
                for (int i = itemOffset; i < endOffset; i++)
                {
                    RadComboBoxItemData itemData = new RadComboBoxItemData();
                    itemData.Text = ((ModuleView.JobBO)lComps[i]).JobNumber.ToString() + " - " + ((ModuleView.JobBO)lComps[i]).JobName.ToString();
                    itemData.Value = ((ModuleView.JobBO)lComps[i]).JobId.ToString();
                    result.Add(itemData);
                }
                if (lComps.Count > 0)
                {
                    comboData.Message = String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset.ToString(), lComps.Count.ToString());
                }
                else
                {
                    comboData.Message = "No matches";
                }
            }
            catch (Exception e)
            {
                comboData.Message = e.Message;
            }
            var json = JsonConvert.SerializeObject(result);

            comboData.Items = result.ToArray();

            return comboData;
        }

 

Is there any way to assign the WebServiceSettings in the codebehind?

 

 

 

 

 

 

Peter Milchev
Telerik team
 answered on 05 Feb 2018
11 answers
841 views

Hi,

In a web application, I use your RadTreeList to display some hierarchical data. Because the amount of data can be large, I set the AllowLoadOnDemand to true and created an OnChildItemsDataBind event handler. The load on demand mechanism works perfectly. 

The RadTreeList contains a various number of column which are dynamically created but the first column is a TreeListSelectColumn which statically created. This allows user to check/unckeck some items in the TreeList and the result (checked items) must be saved in a database. Obviously, when the user reach the TreeList later, the state of the checkboxes must be restored.

Because TreeList items check state must be restored at the TreeList initialisation and the amount of TreeList data can be huge, I am looking for a way to expand all parent items of these checked items.

As an example let's consider this simple TreeList structure :

- Item1

    |_ Item11

        |_ Item111

        |_ Item112

    |_ Item12

        |_ Item121

    |_ Item13

- Item2

    |_ Item21

        |_ Item211
    |_ Item22

If user checked "Item211" and saved his changes, I'd like the TreeList to be initialised like this :

- Item1             (collapsed because no child item are checked)
- Item2             (expanded because a child item is checked)
    |_ Item21     (same here)
        |_ Item211
    |_ Item22

I cannot find a way to achieve this with load on demand feature. The reason is quite simple: the load on demand pattern requires to load only the root elements on TreeList_NeedDataSource event and then gradually child element on TreeList_ChildItemsDataBind event. In my previous example, this means that at page load the TreeList contains only 2 items (Item1 and Item2) so their child cannot be expanded because they does not exists.

However that feature, for me, seems to be very important. When a tree contains a lot of data, user must have a way to access easily to his previous selection without expanding manually all the parent nodes. Also, this feature seems to be necessary if I want to implement a seach feature.

Could you help me ?

Thanks,

 

Eyup
Telerik team
 answered on 05 Feb 2018
0 answers
68 views

Is it possibile to hide columns pressing a button ??

I would like to hide an aggregate column field but not his grand total ..

 

thanks

simone
Top achievements
Rank 1
 asked on 04 Feb 2018
2 answers
256 views
Is there a way to pass additional parameter to FileUploaded event of RadAsyncUpload control.
I want to pass an additional parameter as follows:
this._RadAsyncUpload.FileUploaded += RequiredFileUploaded("EXCEL");
 
private void RequiredFileUploaded(object sender, FileUploadedEventArgs e, string param)
{
}
PLease let me know how to achieve this.
Pat
Top achievements
Rank 1
 answered on 04 Feb 2018
4 answers
354 views
Hi,
I want to use Radlistbox control in my project at several times. But my requirement for look and feel to radlistbox is different what given in telerik.I want the Move buttons to come in middle of Source and destination listboxes and sould have enough gap among themselves.Please find the screen shot i have attached



Regards
Raj
Mya Thandar
Top achievements
Rank 1
 answered on 03 Feb 2018
0 answers
146 views

Hi Guys,

Template, and Document manager previews are not working + I cannot see the word 'preview' at the bottom of the dialogs, right side.
I can click the items and they will load the content into the editor OK; but not preview.
Sometimes on clicking the items, the function icons top left will disappear - please see attached.

<telerik:radeditor runat="server" ID="reuTemplates"  Height="400"  Width="984px" Skin="Bootstrap"  EditModes="All"  ImageManager-SearchPatterns="*.gif, *.jpg, *.jpeg, *.png" OnClientLoad="OnClientLoad" DialogHandlerUrl="~/Telerik.Web.UI.DialogHandler.axd"  TemplateManager-SearchPatterns="*.htm"  
ContentAreaCssFile="~/_admin/css/EditorContentArea.css" ToolsFile="~/_admin/xml/templateTools.xml"  >
</telerik:radeditor>

 

I've changed skins, browser,  and just about everything else I can think of but wondered if you know what could possibly be wrong

URLs ar rewritten, so using axd.

Thanks in advance,

Jack

Jon
Top achievements
Rank 1
 asked on 03 Feb 2018
0 answers
109 views

I am using advanced data binding to filter, sort, and page a Telerik RadGrid. Because the DataSource is set on the NeedDataSource event, the columns and filters are generated based off the structure of the DataSource. Is there a way for the DataSource's select statement to know what columns to put the data in if I explicitly create the columns in the aspx? Right now the select adds the columns in addition to the existing ones.

aspx:

<telerik:RadGrid
    ID="RadGrid1"
    runat="server"
    AllowCustomPaging="True"
    AllowFilteringByColumn="True"
    AllowPaging="True"
    AllowSorting="True"
    OnNeedDataSource="RadGrid1_NeedDataSource"
    EnableLinqExpressions="False">
</telerik:RadGrid>

 

aspx.cs:

protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) {
    //RadGrid1Select is a functioning filter/sort/page
    Select methodRadGridIsows.DataSource = RadGrid1Select();
    RadGridIsows.VirtualItemCount = count;
}

 

I am able to customize column filters by putting them directly in the aspx, however this causes there to be a repeat column because the DataSource columns will bind to it anyways. If there is no way to access the RadGrid columns on databinding, is there a way to associate certain columns in the aspx with the DataSource's DataTable when binding?

 

Marcel
Top achievements
Rank 1
 asked on 02 Feb 2018
1 answer
103 views

Hello - I see the method here that describes how to use the "Add New Record" method.  I was wondering if there was a way to customize that so the data maps below the appropriate header, instead of just a drop down table.

So it would look like this

Name    Title     Address    City   State   Zip

Test       Test     Test           Test    Test    Test

Rumen
Telerik team
 answered on 02 Feb 2018
1 answer
118 views

Can someone help me with the logic to save the column order when they are reordered?

We are using the grid for reporting and want to allow our clients to drag and drop the fields, sort them, etc. When there is a post back the order is reset. I have put in logic that works great of there is only one column that is reordered, but if there are 2 or more it doesn't work. There has to be a much easier way to save the current column order on post back?

We are using AutoGenerateColumns="true". Everything is working perfectly except moving more than one column. Please help ASAP!!

Rumen
Telerik team
 answered on 02 Feb 2018
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?