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

I have RadDatePicker control with SelectedDateChanged event. When I change the Date the event fires with Confirm window. When I click on 'Cancel' button RadDatePicker1_SelectedDateChanged invokes again and it displays Confirm window twice. When I click on 'OK' button it works fine. What could be the problem? Thanks for any suggestions. I am using 2010 Q3 controls.
                       

      <telerik:RadDatePicker ID="RadDatePicker1" runat="server" AutoPostBack="true" OnSelectedDateChanged="RadDatePicker1_SelectedDateChanged" >
                             </telerik:RadDatePicker>
   
   
    protected void RadDatePicker1_SelectedDateChanged(object sender, EventArgs e)
    {
    string radalertscript = "<script language='javascript'>function f(){ radconfirm('Are you sure?', confirmChange, 400, 100) ; Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</script>";
                         Page.ClientScript.RegisterStartupScript(this.GetType(), "radalert33", radalertscript);
     }

Here is Javascript function

    function confirmChange(args) {
        if (args) {
            __doPostBack("<%= hiddenButton1.UniqueID %>", "");
        }
    { var picker = $find("<%= rdpIndictment.ClientID %>");

      var hdval = document.getElementById('hiddenControlOldValue').value;

      picker.set_selectedDate(new Date(hdval));
   }
}
It looks like the problem is setting old value to Date Picker when 'Cancel' button clicked. Is there are any way I can Cancel Date Picker new selected value when 'Cancel' button clicked?

 

 

Keith
Top achievements
Rank 2
 answered on 04 May 2013
1 answer
148 views

 I have a radgrid on my page that I build programmatically within my Page_Init. I use the NeedDataSource to populate my grid. I have pagination enabled along with filtering.

When the user is on my screen the radgrid displays with information that spans multple pages. They can also use filtering to shrink the number of pages down. They will then have the ability to click on a regular asp button. This button will then try to gather all of the ids from all of the records in the radgrid. Not just the records on the current page.

An example:
    1. the radgrid has a pagination set to 100 records. the datasource has a total of 1600 records in it. So I have a radgrid of 16 pages, 100 at a time.
    2. the user uses a filter to shrink the number of pages down to 9 with a total of 850 records showing. the datasource still has 1600 because the radgrid is filtering and not the actual datasource.
    3. the user clicks the button. I want, on the server, to be able to traverse through all 850 records to get their specific datakeyitem and do something like this but the problem is the MasterTableView only has 100 records in it not the 850.

protected void Button1_Click(object sender, EventArgs e)
    {
        foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
        {
            int detailID = dataItem.GetDataKeyValue("DetailID");
            //do something with the detailID
       }
   }

What else can I do to get this? I could try to store the ids that come back during the loading of the radgrid, but to do this I think I would need to take pagination off, rebind, get the ids, put pagination back on, rebind. I don't see something like this as an option because my datasource could have high number of records and binding twice would lead to user's waiting.

Thanks
Jayesh Goyani
Top achievements
Rank 2
 answered on 04 May 2013
1 answer
75 views


Hi,
 The Css styles are not apply for Radcontrols in IE.if i put 2 grid controls the Css styles are applied perfectly.but if i add more than two grid, css styles are not apply for other grids except first two grid.
 

To solve this i have searched in a lots of forum. 

some experts told to add a stylesheetmanager to Combine the stylesheet requests into a single request.
because of IE have some limitation to add more than 31 cssfile.
 
After adding the stylesheetmanager  i am getting the same issue.
Please help me to solve this issue.


Sample code:
  <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
        <StyleSheets>
           <telerik:StyleSheetReference Name="Telerik.Web.UI.Skins.Grid.css" Assembly="Telerik.Web.UI" />
            <telerik:StyleSheetReference Name="Telerik.Web.UI.Skins.Black.Grid.Black.css" Assembly="Telerik.Web.UI" />
            <telerik:StyleSheetReference Name="Telerik.Web.UI.Skins.Forest.Grid.Forest.css" Assembly="Telerik.Web.UI" />
            <telerik:StyleSheetReference Name="Telerik.Web.UI.Skins.Hay.Grid.Hay.css" Assembly="Telerik.Web.UI" />
        </StyleSheets>
    </telerik:RadStyleSheetManager>

Thanks.
 
Jayesh Goyani
Top achievements
Rank 2
 answered on 04 May 2013
3 answers
279 views
Hello,

I struggling through an IE9 specific issue. 
I have RadListBox which I am trying to get its Client ID in Jquery. The way I am doing it is recommended on telerik.com.

var lstBusinessModel = $find("<%=lbBusinessModel.ClientID %>");
var items = lstBusinessModel.get_items();

HTML markup

<telerik:RadListBox ID="lbBusinessModel" Width="200px" Height="300px" OnClientSelectedIndexChanged="BusinessModelSelected" 
 runat="server"></telerik:RadListBox>

It works perfectly fine in Chrome, Firefox, IE8, IE7. The only browser it doesn't support is IE9.

Are you guys aware of this issue?
Can you guys please look into this one and provide me the solution.

Thanks,
Saquib.
Jen Peleva
Telerik team
 answered on 04 May 2013
8 answers
448 views

How would you go about creating dynamic tooltips such as the ones found here:
http://freelance.geekinterview.com/143141-issues-with-jquery-cluetip.html

Basically I got a glossary table in my database with definitions that I want to display as a tooltip in my aspx (c#) pages wherever the a keyword will match that of the glossary..

Something basic will do, such as:
http://plugins.learningjquery.com/cluetip/demo/

Royce
Top achievements
Rank 1
 answered on 04 May 2013
1 answer
79 views
Hi,

My grid has Item Template column with controls. This kind of requirement is on many pages. Some pages have label and textbox in template column. other pages have radio button list or dropdown list. What I am trying to do is write global code to iterate through template column controls and enable or disable them.

Something like this:

private void EnableTemplateContrils(GridTemplateColumn tmpCol)
{
        bool status = false;

    foreach (cell or control in tmpCol)
   {
       enableORDisableControl(control, status);
   }
}

private void enableORDisableControl(System.Web.UI.Control pControl, bool pStatus)
{
    string controlName = pControl.GetType().Name;
    switch(controlName)
     {
         case "TextBox":
                ((WebControl)pControl).enabled = pStatus;
                break;
         case "CheckBox":

     }
}

I appreciate your response. Please let me know how to loop thru controls in template column.

Thanks,
Prathiba
Jayesh Goyani
Top achievements
Rank 2
 answered on 04 May 2013
7 answers
135 views
Dear Telerik-Staff,

in my application, I have an aspx-Page which stores a RadGrid. I am storing all the grid filter (filters, expansions, page) in memory, I am using "Session state" to storing it and i use javaScript for call the method in c#. What should be the right way to apply filters, expansions rows and page? Thanks.
Code: <ClientSettings>
            <ClientEvents OnCommand="RadGridOrders_Command" OnHierarchyCollapsed="RadGridOrders_HierarchyCollapsed" OnHierarchyExpanding="RadGridOrders_HierarchyExpanding" OnDataBound="RadGridOrders_OnDataBound"/>
</ClientSettings> <script> //START SAVE FILTER
function RadGridOrders_Command(sender, args) {
            spinner.spin(spinTarget);
            args.set_cancel(true);
            commandName = args.get_commandName();
            if (commandName == "Page" || commandName == "Filter") {
                for (var i = 0; i < tableView.get_pageSize() ; i++) {
                    tableView.collapseItem(i);
                }
                SaveOrderStatusState(); //Hear i save the filter to memory
            }
} function SaveOrderStatusState() {
            var expandRow = new Array();
            pageIndex = tableView.get_currentPageIndex();
            pageSize = tableView.get_pageSize();
            sortExpression = tableView.get_sortExpressions().toList();
            filterExpression = tableView.get_filterExpressions().toList();
            selectedOrderDate = cbxOrderDateObject.get_selectedIndex();
            selectedOrderStatus = cbxOrderStatusObject.get_selectedIndex();
            selectedOrderStatusOption = cbxOrderStatusOption.get_selectedIndex();
            //Checking the expanded rows
            for (var i = 0; i < tableView.get_dataItems().length; i++) {
                var row = tableView.get_dataItems()[i];
                if (row.get_expanded() == true) {
                    var value = {row: parseInt(row.get_itemIndexHierarchical())};
                    expandRow.push(value);
                }
            }
            state.pageIndex = pageIndex;
            state.pageSize = pageSize;
            state.sortExpression = sortExpression;
            state.filterExpression = filterExpression;
            state.selectedOrderDate = selectedOrderDate;
            state.selectedOrderStatus = selectedOrderStatus;
            state.exandRow = expandRow;
            state.selectedOrderStatusOption = selectedOrderStatusOption;
            var stateJson = JSON.stringify(state);

            Data.Web.Services.Frontend.SaveOrderStatusState(stateJson, callBackSaveSuccess, CallBackError);
} function callBackSaveSuccess() {
//refreshing the Grid
            if (selectedOrderStatusOption == 0) {
    Data.Web.Services.Frontend.GetOpenOrders(tableView.get_currentPageIndex() * tableView.get_pageSize(), tableView.get_pageSize(),   tableView.get_sortExpressions().toList(), tableView.get_filterExpressions().toList(), updateGrid);
            }
            else {
                Data.Web.Services.Frontend.GetOrders(tableView.get_currentPageIndex() * tableView.get_pageSize(), tableView.get_pageSize(), tableView.get_sortExpressions().toList(), tableView.get_filterExpressions().toList(),
                updateGrid);
          }
        } //END SAVE FILTER //STAR GET FILTER AND APPLY //Load the page     $(document).ready(function () {
            tableView = $find("<%= RadGridOrders.ClientID %>").get_masterTableView();
            spinner = new Spinner(spinOptions);
            spinTarget = document.getElementById('<%=RadGridOrders.ClientID %>');
            commandName = "Load"
            spinner.spin(spinTarget);
            GetOrderStatusState(); //here call the filters
        });
        function GetOrderStatusState() {
            Data.Web.Services.Frontend.GetOrderStatusState(successResponse, CallBackError);
        }       function successResponse(jsonString) {
            var jS = JSON.parse(jsonString);
            if (jS) {
                state = JSON.parse(jS);
                pageIndex = state.pageIndex;
                pageSize = state.pageSize;
                sortExpresion = state.sortExpression;
                selectedOrderDate = state.selectedOrderDate;
                selectedOrderStatus = state.selectedOrderStatus;
                selectedOrderStatusOption = state.selectedOrderStatusOption;

                if (selectedOrderStatusOption == null) {
                    selectedOrderStatusOption = 0;
                }

                //Applying the filter for the comboboxes
cbxOrderDateObject.get_items().getItem(selectedOrderDate).select();
                cbxOrderStatusObject.get_items().getItem(selectedOrderStatus).select();
                cbxOrderStatusOption.get_items().getItem(selectedOrderStatusOption).select();

                //re-formatting the date
                if (state.filterExpression.length > 0) {
                    for (var i = 0; i < state.filterExpression.length; i++) {

                        var filter = state.filterExpression[i];
                        if (filter.FieldName == "OrderDate") {
                            filter.FieldValue = isoDateReviver(filter.FieldValue);
                        }
                    }
                }

                filterExpression = state.filterExpression;
}

           //Applying filter
            if (selectedOrderStatusOption == 0) {
                Data.Web.Services.Frontend.GetOpenOrders(pageIndex * pageSize, pageSize,
                    sortExpression, filterExpression,
                       updateGrid);
            }
            else {
                Data.Web.Services.Frontend.GetOrders(pageIndex * pageSize, pageSize,
                    sortExpression, filterExpression,
                       updateGrid);
            } }
 function updateGrid(result) {
            tableView.set_dataSource(result.Data);
            tableView.dataBind();
            if (commandName == "Filter" || commandName == "Load") {
                tableView.set_virtualItemCount(result.Count);
            }
//Applying expanded rows.       if (state.exandRow.length > 0) {
        for (var i = 0; i < state.exandRow.length; i++) {
              var rowItem = state.exandRow[i];
                if (rowItem != null) {
                tableView.expandItem(rowItem.row);
                  }
            }
                        spinner.stop(spinTarget);
} //END GET FILTER AND APPLY


</script>


Thanks.

Vasil
Telerik team
 answered on 03 May 2013
1 answer
123 views
Hi all,

The scenario is as follows:
I have a datasource, which contains a string called "comments" which has rich text. When I bind it to the Grid, I am trying to display the column as an icon and when user hovers over the icon the tooltip is displayed with the text. I used the following code:
My problem is that the tooltip does not show the formatted rich text, it only displays the normal text, without line breaks etc. Is there any way to show rich text on the tooltip or using any other mechanism inside the grid?

<telerik:GridTemplateColumn HeaderStyle-Width="20px" UniqueName="Comments" AllowFiltering="false"
 ItemStyle-VerticalAlign="Bottom" ItemStyle-HorizontalAlign="Left" HeaderText="Comments">
 <ItemTemplate>
 <asp:Image ID="imgInfo" runat="server" ImageUrl="<% $WSSUrl:~info.png%>" />
<telerik:RadToolTipManager runat="server" ID="radTTMgrInfo"  Position="BottomRight" RelativeTo="Element" Width="600px" Height="600px" Animation="Fade" ShowCallout="false" OffsetX="-70" OffsetY="-1" ShowDelay="0" ShowEvent="OnMouseOver" HideEvent="FromCode" OnClientBeforeHide="OnClientBeforeHide" OnClientShow="OnClientShow" Text=' <%# Eval("Comments") %>' ContentScrolling="Y">
<TargetControls>
 <telerik:ToolTipTargetControl TargetControlID="imgInfo" />
 </TargetControls>
 </telerik:RadToolTipManager>
</ItemTemplate>
</telerik:GridTemplateColumn>
Vasil
Telerik team
 answered on 03 May 2013
8 answers
194 views
I'm using a GridHTMLEditorColumn in the RadGrid to enable rich text editing.

It's all within a custom DNN (4.9) module with Ajax enabled.

I'm using ObjectDataSource to enable automatic Edit/Update for the grid, update works fine in IE, but passes OLD data when used in Firefox.

I narrowed it down to RadEditor problem by replacing GridHTMLEditorColumn with GridBoundColumn - worked just fine in both IE and Firefox.

Please help.

p.s. forgot to mention that the problem is with the "Update" being an ImageButton.

The root of the problem is covered in depth in this thread. To make it work, I had to use a "LinkButton" instead of the ImageButton.
Vasil
Telerik team
 answered on 03 May 2013
1 answer
176 views
I need this bar chart to label each bar with the data from the DataXColumn. The Values range from 1000-1200. The problem is that the chart starts the XAxis range at 0 so all my bars are clustered together in the middle of my chart. If I set Auto Scale to False, all my bars disappear and the XAxis range is 1.-7. How do I set the Xaxis plot range?

<telerik:RadChart runat="server" ID="rcBar" DefaultType="Bar" DataSourceID="sdsBar" Width="600px" Height="500px">         
                 <PlotArea>
                    <XAxis></XAxis>
                 </PlotArea>
                 <Series>
                    <telerik:ChartSeries Name="BarVals" DataYColumn="YCol" DataXColumn="XCol" Type="Bar">
                    </telerik:ChartSeries>   
                </Series>
                <ChartTitle>
                 <TextBlock Text="Chart 1">
                 </TextBlock>
                </ChartTitle>
</telerik:RadChart>
Alex
Top achievements
Rank 1
 answered on 03 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?