Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
571 views
Hi I am trying the set the SelectedValue in the item databound event as follows
Protected Sub RadGrid1_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound  
       If TypeOf e.Item Is GridEditFormItem AndAlso e.Item.IsInEditMode Then
            Dim editform As GridEditFormItem = DirectCast(e.Item, GridEditFormItem)
           Dim combo As RadComboBox = DirectCast(editform.FindControl("RadComboBox1"), RadComboBox)
           combo.SelectedValue = "123
       End If
End Sub

and this works as it is, but I actually want to have the SelectedValue set to a specific column value of the selected row, but I am not sure how I can get this value at this point

Basically I am trying to replicate what happens declaratively when you have SelectedValue='<%# Bind("ColumnName") %>'  but be able to intercept the value in case it does not exist in the list of values in the combobox and causes the 'Out of range' error.

Please advise !
Mike
Top achievements
Rank 2
 answered on 04 May 2012
1 answer
160 views
ive got a function in the code behind that automatically adds an expression on a tab click on a mutli page.
but clicking back a tab simply creates another one.
how can i clear it FIRST AND THEN add the expression. i was hoping the RecreateControl would work

 

 

protected void showfilterTabs(int tab)

 

{

 

 

if (tab == 0)

 

{

 

 

RadFilterStartsWithFilterExpression expr1 = new RadFilterStartsWithFilterExpression("WORKORDERNUMBER");

 

expr1.Value =

 

"";

 

WorkOrdersRadFilter.RootGroup.AddExpression(expr1);

WorkOrdersRadFilter.RecreateControl();

}

 

 

else if (tab == 1)

 

{

 

 

RadFilterStartsWithFilterExpression expr1 = new RadFilterStartsWithFilterExpression("WORKORDERNUMBER");

 

expr1.Value =

 

"";

 

WorkOrderItemsRadFilter.RootGroup.AddExpression(expr1);

WorkOrderItemsRadFilter.RecreateControl();

}

 

 

else if (tab == 2)

 

{

 

 

RadFilterStartsWithFilterExpression expr1 = new RadFilterStartsWithFilterExpression("WORKORDERNUMBER");

 

expr1.Value =

 

"";

 

SearchAllOrdersRadFilter.RootGroup.AddExpression(expr1);

SearchAllOrdersRadFilter.RecreateControl();

}

 

 

else if (tab == 3)

 

{

 

 

RadFilterStartsWithFilterExpression expr1 = new RadFilterStartsWithFilterExpression("WORKORDERNUMBER");

 

expr1.Value =

 

"";

 

StorageWorkOrdersRadFilter.RootGroup.AddExpression(expr1);

StorageWorkOrdersRadFilter.RecreateControl();

}

 

 

else if (tab == 4)

 

{

 

 

RadFilterStartsWithFilterExpression expr1 = new RadFilterStartsWithFilterExpression("WORKORDERNUMBER");

 

expr1.Value =

 

"";

 

SearchAllItemsRadFilter.RootGroup.AddExpression(expr1);

SearchAllItemsRadFilter.RecreateControl();

}

 

 

else if (tab == 5)

 

{

 

 

RadFilterStartsWithFilterExpression expr1 = new RadFilterStartsWithFilterExpression("WORKORDERITEMDISPLAY");

 

expr1.Value =

 

"";

 

InventoriesRadFilter.RootGroup.AddExpression(expr1);

InventoriesRadFilter.RecreateControl();

}

}

rik butcher
Top achievements
Rank 1
 answered on 04 May 2012
4 answers
296 views
I am creating a Hierarchical grid programmatically by using a radgrid with a GridTableView.  This is generated fine without issue.  What I would like to do is have a row click on the gridtableview rows as well as the mastertable rows.  So when I click the expand icon on the main grid, the sub rows will fire the same rowclick.  Which does happen, howeveer I can not seem to get hold of the datakeyvalue of the gridtableview.  For example, my javascript rowclick,
function RowClick(sender, eventArgs) {
    eval(eventArgs.getDataKeyValue("ROWCLICK"));
}
RowClick fires fine, but the getDataKeyValue is always null for the sub rows (which i believe is the gridtableview).  Any help with this would be much appreciated.

I have a similar issue with the contextmenu, but I guess it would be related to getting the datakeyvalue for the gridtableview.
mabs
Top achievements
Rank 1
 answered on 04 May 2012
3 answers
133 views
Good afternoon. I am currently experiencing a problem. I am using the RadWindow as a dialog and allowing the user to fill out information on the dialog. When the dialog is closed, I am retrieving the values from the dialog (using the exact same technique described here:http://demos.telerik.com/aspnet-ajax/window/examples/dialogreturnvalue/defaultcs.aspx)  and setting them as values on the parent browser window. The textboxes that I am populating are inside of a RadGrid. They populate just fine but if I click the Cancel button after populating them, I get the following error:

'Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Invalid JSON primitive: Setup.' when calling method: [nsIDOMEventListener::handleEvent]

Any help would be appreciated.

Marin Bratanov
Telerik team
 answered on 04 May 2012
1 answer
107 views
Hi,
I have a problem with radwindow. When I open pdf in radwindow and move this radwindow the element send other request and reload the pdf everytime, when I open normal html page not sent other request.


Can I move without everytime reloading?

Thank you.


<head runat="server">
    <title></title>
    <script type="text/javascript">
        function LoadUrl() {
            //var windowURL = document.getElementById("url").value;
            var oWnd = radopen("http://www.kernel.org", null);
            oWnd.setSize(900, 400);
            oWnd.center();
        }
 
        function LoadPdf() {
            var oWnd = radopen("http://www.irs.gov/pub/irs-pdf/fw4.pdf", null);
            oWnd.setSize(900, 400);
            oWnd.center();
        }
 
        function LoadGoogle() {
            var oWnd = radopen("https://docs.google.com/gview?url=http://www.irs.gov/pub/irs-pdf/fw4.pdf", null);
            oWnd.setSize(900, 400);
            oWnd.center();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
     
        <telerik:RadScriptManager runat="server"></telerik:RadScriptManager>
 
        <input type="button" id="url" value="Open Url" onclick="LoadUrl()" />
        <input type="button" id="Button1" value="Open Pdf" onclick="LoadPdf()" />
 
        <telerik:RadWindowManager ID="rwm" Modal="true" runat="server"></telerik:RadWindowManager>
 
    </div>
    </form>
</body>
</html>
Marin Bratanov
Telerik team
 answered on 04 May 2012
6 answers
273 views
is there a way in the code behind on page load to automatically make the rad filter default as if a user has clicked
the "And" - see screenshot
. it would be great if i could default this to behave as if the user had clicked the "Add Expression" button.
any help is appreciated.
thanks again
rik


 <telerik:RadFilter ID="WorkOrdersRadFilter" runat="server" Skin="WebBlue" ShowApplyButton="true"
                        OnApplyExpressions="WorkOrdersRadFilter_Apply" ApplyButtonText="Filter Work Orders"
                        OnPreRender="WorkOrdersRadFilter_PreRender" OnFieldEditorCreating="RadFilter_FieldEditorCreating"   OnItemCommand="WorkOrdersRadFilter_ItemCommand">
                       
                        <FieldEditors>
                            <telerik:RadFilterTextFieldEditor FieldName="WORKORDERNUMBER" DisplayName="Work Order#"
                                DataType="System.String" />  </FieldEditors>
                                  
</telerik:RadFilter>
rik butcher
Top achievements
Rank 1
 answered on 04 May 2012
1 answer
205 views
I have a modal window that I am firing on an icon click. When the window loads, it's low and right of where it should be. If you close the window and select the icon again, the window appears in the correct position. Any clue what is going on?

Marin Bratanov
Telerik team
 answered on 04 May 2012
1 answer
301 views
Hi Team,

Can i have a line-break in RadToolTip to work with line-feed "\n" instaed of "<br/>"
Marin Bratanov
Telerik team
 answered on 04 May 2012
1 answer
209 views
Thanks to the forums I have been able to create a RadWindow popup when a user mouses over a RadTreeView node. But the problem I am running into is that I don't want to constrain the user to the original items surface for the mouse out to close the popup, but want to allow the user to move the mouse within the popup window to do other actions then upon mouse out close.

Hence, I want to constrain the mouse out to the new window and not the original small node surface. But I have been unable to achieve that. Where should I put the mouse out code? Here is what I have tried, note that the windowpane variable is null and never attaches the alerts.

function HandleHoverStart(sender, eventArgs) {
    var node = eventArgs.get_node();
 
    if (node != null) {
        var pos = GetElementPosition(node.get_element());
 
        var oManager = GetRadWindowManager();
 
        var metaWindow = oManager.open(null, "DocumentMetaRadWindow");
 
        var windowPane = document.getElementById("RadWindowWrapperElement" + metaWindow.Id);
 
        if (windowPane != null) {
 
            windowPane.onmouseenter = function () { alert('RadWindow enter'); };
            windowPane.onmouseout = function () { alert('RadWindow out'); };
        }
 
        var X = pos.x;
        var Y = pos.y;
 
        metaWindow.MoveTo(X, Y + node.offsetHeight);
 
    }
}


Marin Bratanov
Telerik team
 answered on 04 May 2012
1 answer
189 views
As you know the RadComboBox has a property called 'ShowDropDownOnTextboxClick' which opens the dropdown when the textbox is clicked. Thing is, i use a combobox without allowing custom text (i configured it to be like a standard but styled asp.net dropdown). So i need the exact opposite of the feature above. I want the dropdown to open and close when the textbox is clicked depending on the current visibility of the dropdown. Before i'm extending the ComboBox to build this in myself i thought i'd post this here since theres probably more people experiencing this. Is there a way i could toggle the dropdown on textbox-click?

Thanks in advance,

Max
Dimitar Terziev
Telerik team
 answered on 04 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?