Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
177 views
Hello

When using the  RadFilterSqlQueryProvider and using a datetime field in the Radfilter the result of the provider.Result call is for example:

([date)] >= '23-11-2011 16:00:00')

For SQL however one expects:
([date)] >= CONVERT(DATETIME, '2011-11-23 16:00:00', 102))

The other providers of the Radfilter also don't give a result that could be used in a where clause of an SQL statement. Do you have a solution to this?
One would expect that a custom sqlprovider (with base class RadFilterSqlQueryProvider) would be available for e.g. ms-sql and mysql.

Thanks
Piet

Eyup
Telerik team
 answered on 21 Mar 2018
1 answer
409 views

I have two RadListBox. Data in first box is populated from database using RadListBoxItem and I have set an attribute for each item. In the second box, I've created custom context menu. After I adding the item from first box to second box, user can select some option using the context menu. On context menu selection, I need to get the Attribute I set before and update the attribute value according to the context menu selection so I can used it for later process.Currently, I unable to even the attributes I set previously using the context menu's javascript. Please guide how to read ListItem's attribute and update the attribute to a new value.

 

This is how I add the item to the first box with attribute.

this._sortingList = new List<Sorting>();
this._sortingList = DBConnection.getSortingList();
 
foreach (var s in this._sortingList)
 {
        RadListBoxItem item = new RadListBoxItem();
        item.Text = s.Description;
        item.Value = s.Id.ToString();
        item.Attributes["myorder"] = "0";
        this.RadListBox1.Items.Add(item);
}

 

Thus custom context menu javascript.

    function showContextMenu(sender, e) {
    var menu = $find("<%= cm1.ClientID %>");
    var rawEvent = e.get_domEvent().rawEvent; menu.show(rawEvent);
    e.get_item().select();
    $telerik.cancelRawEvent(rawEvent);
 
}
function onItemClicked(sender, e) {
    var listBox = $find("<%= RadListBox1.ClientID %>");
    var listItem = listBox.get_selectedItem();
    var menuItem = e.get_item();
    if (menuItem.get_text() == "Ascending"){
        alert(listItem.get_attributes().getAttribute("myorder"));
    }
    else if (menuItem.get_text() == "Descending") {
        alert(listItem.get_attributes().getAttribute("myorder"));
    }
}
Gangatharan
Top achievements
Rank 1
 answered on 21 Mar 2018
0 answers
119 views

I have two RadListBox. Data in first box is populated from database using RadListBoxItem and I have set an attribute for each item. In the second box, I've enabled custom context menu. After I adding the item from first box to second box, user can select some option using the context menu. On context menu selection, I need to get the Attribute I set before and update the attribute value according to the context menu selection so I can used it for later process.Currently, I unable to even the attributes I set previously using the context menu's javascript. Please guide how to read ListItem's attribute and update the attribute to a new value.

 

This is how I add the item to the first box with attribute.

this._sortingList = new List<Sorting>();
this._sortingList = DBConnection.getSortingList();
  
foreach (var s in this._sortingList)
 {
        RadListBoxItem item = new RadListBoxItem();
        item.Text = s.Description;
        item.Value = s.Id.ToString();
        item.Attributes["myorder"] = "0";
        this.RadListBox1.Items.Add(item);
}

 

This is custom context menu javascript.

function showContextMenu(sender, e) {
    var menu = $find("<%= cm1.ClientID %>");
    var rawEvent = e.get_domEvent().rawEvent; menu.show(rawEvent);
    e.get_item().select();
    $telerik.cancelRawEvent(rawEvent);
  
}
function onItemClicked(sender, e) {
    var listBox = $find("<%= RadListBox1.ClientID %>");
    var listItem = listBox.get_selectedItem();
    var menuItem = e.get_item();
    if (menuItem.get_text() == "Ascending"){
        alert(listItem.get_attributes().getAttribute("myorder"));
    }
    else if (menuItem.get_text() == "Descending") {
        alert(listItem.get_attributes().getAttribute("myorder"));
    }
}
Gangatharan
Top achievements
Rank 1
 asked on 21 Mar 2018
2 answers
276 views

Hi,

Sorry if this has been asked elsewhere, I cannot find any answers on this topic..

I am using a media player in a dockzone control which works great.  The only issue I have is the player, which is set to autoplay, shows the titlebar and play controls automatically on start and only disappears when the user hovers over the control and then off it.  I would like the player ONLY to show the controls when the user hovers over it (ie do not show it until they want to control the video).

Thanks!

Eyup
Telerik team
 answered on 21 Mar 2018
4 answers
194 views
I have tasks in my current implementation that run to 6pm but the timeline only shows 8am to 4pm. How do I go about adjusting the Gantt to show 7am to 6pm?
Kasim
Top achievements
Rank 2
 answered on 21 Mar 2018
6 answers
507 views
I have a RadGrid with EditMode="Batch".  It has a template column.  In this column (in the EditItemTemplate) is a RadComboBox with CheckBoxes="True".  

<telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" GridLines="None"
    AllowMultiRowEdit="True"
    AutoGenerateColumns="False" AllowAutomaticInserts="False" AllowAutomaticUpdates="False"
    OnNeedDataSource="GridNeedDataSource"
    OnPreRender="GridPreRender">
    <MasterTableView AllowSorting="True" EditMode="Batch">
        <Columns>
            <telerik:GridBoundColumn DataField="Id" HeaderText="Id" UniqueName="IdColumn" Display="False" ReadOnly="True">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn HeaderText="Test Values" UniqueName="TestValuesColumn" ItemStyle-Width="400px">
                <EditItemTemplate>
                    <telerik:RadComboBox runat="server" ID="TestValuesComboBox" DropDownAutoWidth="Enabled"
                        HighlightTemplatedItems="True" CheckBoxes="True" EnableCheckAllItemsCheckBox="True">
                    </telerik:RadComboBox>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
        <BatchEditingSettings OpenEditingEvent="DblClick" />
    </MasterTableView>
</telerik:RadGrid>

protected void GridPreRender(object sender, EventArgs e)
{
    RadGrid grid = sender as RadGrid;
    if (grid != null)
    {
        GridTableView masterTable = grid.MasterTableView;
 
        var editor = masterTable.GetBatchEditorContainer("TestValuesColumn");
        var comboBox = (RadComboBox)editor.FindControl("TestValuesComboBox");
        comboBox.Items.Clear();
 
        for (int i = 1; i <= 10; i++)
        {
            RadComboBoxItem item = new RadComboBoxItem();
            item.Text = i.ToString();
            item.Value = i.ToString();
 
            comboBox.Items.Add(item);
            item.DataBind();
        }
    }
}

What I need to do is pre-check the values that have been previously saved.  I realize that there is really only "one" editor for the entire column, so I was wondering if there was some javascript (handling the BatchEditOpening maybe?) that could run through a comma separated list contained in a hidden field or something, and check the appropriate values when opening the cell for editing?  I set the contents of the RadComboBox in the grid's PreRender event, so it's only done once.

Perhaps another option is to have the RadComboBox set with EnableLoadOnDemand="true" and handle the OnItemsRequested to reload and select the data, after it handles the OnClientDropDownOpening="ClearComboBox" with the following code:

function ClearComboBox(sender, args) {
    if (sender.get_items().get_count() == 0) {
        return;
    }
    else {
        sender.clearItems();
        sender.requestItems("parameter", true);
    }
}

The trouble with option #2 is that I'm not sure how to get any values for that particular row to set up in code-behind.  So I don't know how to get the data from the database for that record.  Also, this will make a call to the database every time they open the ComboBox.

Any thoughts?


Eyup
Telerik team
 answered on 20 Mar 2018
0 answers
132 views

I have the following html:

<sq8:GridTemplateColumn DataField="FieldToFillChoiceValue" FilterImageToolTip="" HeaderText="" SortExpression="FieldToFillChoiceValue" UniqueName="FieldToFillValue" FilterControlAltText="">
    <EditItemTemplate>
        <sq8:TextBox runat="server" ID="tbFieldToFill" ValidationGroup="DecisionGroup" />
        <sq:BindableControl runat="server" TargetControlID="tbFieldToFill" DataField="FieldToFillTextValue"></sq:BindableControl>
        <asp:CustomValidator runat="server" ErrorMessage="CustomValidator" ID="cvFieldToFill" ValidationGroup="DecisionGroup"></asp:CustomValidator>
        <sq8:ComboBox runat="server" ID="cmbFieldToFill" ValidationGroup="DecisionGroup">
            <Localization NoMatches="" ShowMoreFormatString="" AllItemsCheckedString="" ItemsCheckedString="" CheckAllString="" MoreItemsWithoutTotalRowCount="" NoMoreItemsWithoutTotalRowCount=""></Localization>
        </sq8:ComboBox>
        <sq:BindableControl runat="server" TargetControlID="cmbFieldToFill" DataField="FieldToFillChoiceValue" />
    </EditItemTemplate>
    <ItemTemplate>
        <asp:Literal runat="server" ID="FieldToFillChoiceValue" Mode="Encode" />
        <sq:BindableControl runat="server" TargetControlID="FieldToFillChoiceValue" DataField="FieldToFillChoiceValue" />
        <asp:HiddenField runat="server" ID="hfFieldType" />
        <sq:BindableControl runat="server" TargetControlID="hfFieldType" DataField="FieldToFillType"></sq:BindableControl>
    </ItemTemplate>
</sq8:GridTemplateColumn>

 

And I'm signed to OnBatchEditOpening and OnBatchEditOpened events.

My problem is that when I get to the OnBatchEditOpened handler, the value of tbFieldToFill is "TextBox" (which is the value of the hidden field) without me setting or binding any value to the control.

In the OnBatchEditOpening handler, the text box still haven't been rendered.

How and why does the value get into the textbox control?

Thanks for any help.

Evgeny
Top achievements
Rank 1
 asked on 20 Mar 2018
0 answers
230 views

Hello,

I have 3 web parts each of which raise a different client side event to which the other 2 web parts react. Two of the web parts are asp .NET (Telerik) while the third is strictly client side JavaScript and REST services.

My issue is that the 2 asp .net web parts each perform a post back when they react to the event, passing some data to the server. Only one of the asp .net web parts processes their post back correctly. If the other ASP .NET web part is removed, everything works correctly.

I have considered serializing the post backs, so that one does not occur until the first has completed and rendered back to the client.

Is there a better way? Also my post backs are not showing the loading panel which does appear normally.

My client side event listener and post back code looks like this:

document.addEventListener('ADSBarcodeEvent', function (evt) {
    var barcode = evt.detail[0];
    var assetType = evt.detail[1];
    __doPostBack("<%=HiddenSearchRadButton.UniqueID%>", barcode + "||" + assetType);
}, false);

and on the server:

protected void HiddenSearchRadButton_Click(object sender, EventArgs e)
 {
     ProcessingExternalEvent = true; // stop infinite loop of events
 
     string passedArgument = Request.Params.Get("__EVENTARGUMENT");
     // barcode + "||" + assetType
     if (passedArgument.Contains("||"))
     {
         string[] delimiter = new string[] { "||" };
         string[] arguments = passedArgument.Split(delimiter, StringSplitOptions.None);
         string barcode = arguments[0];
         string assetType = arguments[1];
Marcel
Top achievements
Rank 1
 asked on 19 Mar 2018
1 answer
108 views

Dears,

 

I am new to RadGrid. I've a grid displayed without the Add New Record button. 

 

I dont understand that. I am using NeedDataSource event to bind the data

 

Regards,

 

Endashaw

Rumen
Telerik team
 answered on 19 Mar 2018
4 answers
469 views
I can't make the radpagelayout control has 100% width and height in big resolution (1920x1080). Do you can help me?
Flemming
Top achievements
Rank 1
Veteran
 answered on 17 Mar 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?