Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
255 views
Hello,

Using RadControls for ASP.NET v2011.2.712.35

I have a RadGrid with client-side row click event defined as follows:

<telerik:RadGrid runat="server" ID="RadGrid_Combo" ... >
    <ClientSettings EnableRowHoverStyle="true">
        <ClientEvents
            OnGridCreated="OP_RadGrid_GridCreated"
            OnRowSelected="OP_RadGrid_RowSelected"
            OnRowDeselected="OP_RadGrid_RowDeselected"
            />
    <MasterTableView TableLayout="Fixed">
        <Columns>
            <telerik:GridImageColumn UniqueName="ImageUrl"
                DataAlternateTextField="ObjectType"
                DataAlternateTextFormatString="{0} Object"
                DataImageUrlFields="ImageUrl"
                DataType="System.String"
                HeaderText="Type"
                ImageAlign="Middle"
                ImageHeight="16px"
                ImageWidth="16px"
                >
                <HeaderStyle Width="25px" Wrap="false" />
            </telerik:GridImageColumn>
...
</telerik:RadGrid>

My Javascript is:

<script type="text/javascript">
function OP_RadGrid_RowSelected(sender, args)
{
    // do some stuff
    ...
}
</script>

When I click on a row in the RadGrid, the OP_RadGrid_RowSelected() event fires just fine.

However, when I click on the image in the GridImateColumn, the OP_RadGrid_RowSelected() event DOES NOT fire.

How can I make the OP_RadGrid_RowSelected() fire when I click on the Image?

Thanks,
Randall Price
Senior Developer
Virginia Tech
Attila Antal
Telerik team
 answered on 05 Feb 2018
2 answers
63 views

I have this weird problem.  Maybe is that I don't understand how a fixed position Menu works.  Anyway,  here are some simple code I used:

 

<style>

    .fixmenu {

 

Vessy
Telerik team
 answered on 05 Feb 2018
0 answers
94 views

Hi,

How to Edit Selected Rows of a Grid using Client Side Scripts? I am able show the value from a List in the Grid and then when i select the rows and click on Edit Button i should be able to edit only one column value of the selected rows.

How can i achieve this requirement? Please let me know any way to get this done.

Below is my code:

<telerik:GridTemplateColumn DataField="ResourceCapacity" ColumnEditorID="clmResCap" UniqueName="ResourceCapacityTemplateColumn" HeaderText="ResourceCapacity">
                            <ClientItemTemplate >
                                #=ResourceCapacity#
                            </ClientItemTemplate>
                                
                           <EditItemTemplate >
                               <telerik:RadNumericTextBox runat="server" DataField="ResourceCapacity" ID="txtResourceCapacity" HeaderText="ResourceCapacity"></telerik:RadNumericTextBox>
                           </EditItemTemplate>
                                                       
                        </telerik:GridTemplateColumn>

Regards

Agasthya

agasthya
Top achievements
Rank 1
 asked on 05 Feb 2018
2 answers
110 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
257 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
732 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
45 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
182 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
293 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
95 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
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?