Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
23 views

Hi,

I would like to use a version of this code

// Event fires upon a cell is intering into edit mode
function OnBatchEditOpening(sender, args) {

    // get the unique name of the column
    var columnName = args.get_columnUniqueName();

    // get the currently edited row's ID
    var rowId = parseInt(args.get_row().id.split("__")[1]);

    // Setup a condition for the row ID
    if (rowId % 3 == 0) { // If condition 1 is met

        // if this row and the Freight column
        if (columnName == "Freight") {
            // cancel the Editing event
            args.set_cancel(true);
        }
    } 
}

to get the value of the cell.  If the cell is empty (null or a space), then I don't want the cell to be editable.  In this Javascript, how do I get the actual value of the cell?

This code is getting me close

var cell = args.get_cell();
alert(cell.childNodes[0].innerHTML)

but it is showing the whole span, like this:
<span id="ctl00_MainContent_mygrid_ctl00_ctl10_mylabel">this is the value I want to access</span>

Thanks!

Nancy
Top achievements
Rank 1
Iron
 answered on 22 Feb 2024
0 answers
20 views

Hi everybody,

I have a problem with dialog.
When I replaced the .ascx files in the "EditorDialogs" folder located in the Telerik.UI installation. I clicked on "Insert Table" then clicked "Cell Properties". I see the Dialog height has been shortened.
Have I updated it wrongly or am I missing something? I hope you can help me.

Thank you very much!

Dai
Top achievements
Rank 1
 asked on 21 Feb 2024
1 answer
20 views
I want to check on the server side if the user has selected an item from the drop-down list, or if he has entered custom text. With a RadComboBox, the SelectedIndex property is -1 for custom text, and 0, 1, 2, ... for a drop-down item. But the MultiLineComboBox does not have such a property. How else can I check on the server side if the user has entered custom text?
Vasko
Telerik team
 answered on 20 Feb 2024
1 answer
29 views

Hi,

My situation: I have a Radgrid with TooltipManager setup which works fine.

Now I have to place another RadGrid in the Tooltip which has an update button per row.
How would one configure so, that the Tooltip's RadGrid is updated in the Tooltip.
Please see attached screenshot...

Thanks for any pointers.

Marc

Vasko
Telerik team
 answered on 20 Feb 2024
1 answer
26 views

Hi,

Could you, please help me find code examples for how to format filter dropdown items of decimal and datetime fields(columns) in telerik:RadGrid.
We need a comma separator for decimal fields.  Also, there is a chance of negative values, so in that case, we need to show its absolute value(within parentheses).
In the case of datetime fields, we need only the date without the time part (date format will be different for different agencies).

We changed the format of Invoice Date column in  ItemDataBound event as below.

dataItem["Date"].Text = rowItem.Date.ToString(AgencyDateFormat);

But it only changed the grid column values, not the filter dropdown.(image of mentioned issue is given below)

We changed the format of Amount column in  ItemDataBound event as below.

dataItem["Amt"].Text = string.Format("{0:0,0.00;(0.00)}", rowItem.Amt);

But it only changed the grid column values, not the filter dropdown.(image of mentioned issue is given below)

 

What we need is for the values shown in the filter will be in the same format of the corresponding column.

I solved this issue by using following code:

private void RadGrid_GridFilterCheckListItemsRequested(object sender, GridFilterCheckListItemsRequestedEventArgs e)
        {
            string filterKey = e.Column.UniqueName;
            List<string> listOfItems = GetList(filterKey);

            foreach (var item in listOfItems)
            {
                if (e.Column.DataType == typeof(DateTime))
                {
                    DateTime datimeObj;
                    if (DateTime.TryParse(item, out datimeObj))
                    {
                        e.ListBox.Items.Add(new RadListBoxItem
                        {
                            Text = datimeObj.ToString(AgencyDateFormat),
                            Value = item
                        });
                        e.ListBox.DataTextFormatString = AgencyDateFormat;
                    }
                }
                else if (e.Column.DataType == typeof(decimal))
                {
                    decimal moneyObj;
                    if (decimal.TryParse(item, out moneyObj))
                    {
                        e.ListBox.Items.Add(new RadListBoxItem
                        {
                            Text = string.Format("{0:0,0.00;(0.00)}", moneyObj),
                            Value = item
                        });
                    }
                }
                else
                {
                    e.ListBox.DataSource = listOfItems;
                }
            }
            e.ListBox.DataBind();
        }

There is one more issue I'm facing. If the column contains a null or empty string, then I need to show them as "(Empty)" in the filter drop-down. How to do this?

We will appreciate your help.

Thanks

            
Vasko
Telerik team
 answered on 19 Feb 2024
0 answers
24 views
I have RadDatePicker in detail window for grid. I need to modify background color dynamically so I added new script to Calender like this:
datePicker.Calendar.ClientEvents.OnLoad = initMethodName;
Now I noticed that calendar is never destroyed from page. If I close detail window and open it again then initialization method is called twice.
It looks that table element with id "<ctrl_name>_calendar" is always there and never unloaded.

Can you help me how to dispose this object or remove event from it?

Thank you.
Petr
Top achievements
Rank 1
Iron
 asked on 16 Feb 2024
0 answers
22 views
I have a Windows 11 machine with a Logitech mouse.  When I have the mouse pointer within a RadGrid, I can turn the mouse wheel to scroll the grid contents vertically and I can hold down the SHIFT key and turn the mouse wheel to scroll the grid contents horizontally.  Alternatively, I can hold the mouse wheel down and move the mouse to scroll the contents vertically or horizontally.  As soon as I freeze columns in the RadGrid, I lose the ability to scroll horizontally with the mouse wheel.

The issue can be demonstrated on the Telerik Web UI Grid Scrolling Demo page by enabling/disabling frozen columns.

Is this something that can be looked into?

Regards,
Dave
David
Top achievements
Rank 1
 asked on 13 Feb 2024
1 answer
36 views

Hi,

Just started digging in to using the RadScheduler.

I am using Timeline view, GroupBy resource, and GroupingDirection Vertical.

There is a misalignment on the groupings.  Two issues I see...

1) The row lines for the resource do not align with the appointment horizontal lines

2) Some appointments look to align with the incorrect resource.  Appointment aaa-137 uses resource 137, but the block spans both 136 and 137 and it in fact looks to be assigned to 136.

 

How can I fix this?

Attila Antal
Telerik team
 answered on 05 Feb 2024
2 answers
33 views

I displayed a lot of charts which contains too many data. So I define XAxis.MaxValue and/or XAxis.MinValue at the beginning. User can use zooming and panning function if needed. But sometimes it is not clear that some part of chart is not visible and how many values are hidden. If I understand well then "Data Navigation" can be used only for date axis, but it is not true in most of my cases.

My idea is to display below chart "Range Slider" and simply show left and right boundary of the chart. At the beginning it will be enough just to display the position (after events drag/zoom). Later I want implement that user can change the zoom and position of chart by using the slider, but I am not sure if it is possible to modify chart by client methods.

Did anybody try to implement something like that or is there any similar functionality which I didn't noticed?

Thank you,

Petr

Petr
Top achievements
Rank 1
Iron
 answered on 02 Feb 2024
1 answer
28 views
Based on the documentation I've seen, the Avatar control is looking for a url for the image. Is there a way to display a binary image from a sql datasource instead?
Rumen
Telerik team
 answered on 02 Feb 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?