Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
219 views
Hi All,

I have the follow scenario:

There are 2x RadDateTimePickers on a RadWindow along with a checkbox. When the checkbox is checked they both become enabled.

I pass the dates back to my main window when the RadWindow is closed. I would like to prevent the RadWindow from closing and alert the user when their values are invalid. Examples: The input fields are enabled, but empty. The second field is larger than the first, etc. 

The main problem here is that my close function which closes the RadWindow fires before the form validation. I read that to avoid this I should move my close function to server-side, but I am not sure this is a viable solution because I pass arguments back from the RadWindow to the main window.

How can I fix this?

Sean

Marin Bratanov
Telerik team
 answered on 24 Mar 2011
3 answers
100 views
Hello,
I am running into a strange error when trying to implement a version of http://blogs.telerik.com/toddanglin/posts/08-12-12/showing_radtooltip_on_radinput_input_error.aspx.  The error is "htmlFile: Unspecified error." and is called from var n=q.getClientRects(); which is in turn called from var b=$telerik.getLocation(a) in the Telerik JavaScript.

Any help in pointing out the cause of this would be appreciated.

Steps To Reproduce:
  1. Enter a valid mm/yyyy value in the first textbox, e.g. 1/2011
  2. Click outside of the textbox and ensure it loses focus

Svetlina Anati
Telerik team
 answered on 24 Mar 2011
2 answers
545 views
I am using a radGrid with UserControl to handle editing and inserts.

I am binding the grid at runtime, similar to the example on http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/usercontroleditform/defaultvb.aspx

After executing the insert command, I would like the grid to return to default mode (i.e. leave insert mode), but have been unable to do this.  I am using the UpdateCommand - code as below.  The item is successfully added to the database, but I get a jscript error

"Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Insert item is available only when grid is in insert mode."

Basically, I am looking for the ASP.Net gridview equivalent of edititemindex = -1.  Are you able to assist.

Thanks
Ben


Private Sub RadGrid1_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.UpdateCommand

    Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)

 

 

 

    Dim userControl As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl)

 

        strID =

CType(userControl.FindControl("txtID"), TextBox).Text    

 

        DataComponent.SaveAsset(strID)

        RadGrid1.MasterTableView.IsItemInserted = False

 

 

 

 

        Me.RadGrid1.Rebind()

 

 

 

    

 

 

 

End Sub

 


Ben
Top achievements
Rank 1
 answered on 24 Mar 2011
4 answers
125 views
I have a panel bar in a master page and I have code in my vb of the master page to set the selected link to show like so

Dim clickedItem As RadPanelItem = RadPanelBar1.FindItemByUrl(Request.Url.PathAndQuery)
 
If Not (clickedItem Is Nothing) Then
    clickedItem.ExpandParentItems()
    Dim childItem As RadPanelItem
    For Each childItem In clickedItem.PanelBar.GetAllItems()
        childItem.CssClass = ""
    Next childItem
 
    clickedItem.CssClass = "rpSelected"
 
End If

The problem is, I have some pages you can get to by links within other pages that aren't in the panel bar. I would like to manually set the panel bar on these pages. However, I'm having trouble figuring out how I can get the control because it's in a master page. I've tried something like this 
        Dim clickedItem As RadPanelItem = Master.FindControl("Radmenu1")
        Dim rad As RadPanelItem = clickedItem.FindItemByUrl("Leads/LeadList.aspx")
but I can't seem to figure out how to get the control to set which item. Any ideas?
Web Services
Top achievements
Rank 2
 answered on 24 Mar 2011
3 answers
89 views
Hi
I am using the following master deatil grid. When user view 's this page, it is exapanding only the first record and shows it's detials. I would like view all the records as expanded.  This is the workflow, i want the user to view all the records at once. How can i do this?


<telerik:RadGrid ID="grdWorkFlow" runat="server" Width="100%" ShowStatusBar="True" AutoGenerateColumns="False"
                                            PageSize="7" AllowSorting="True" AllowPaging="True" GridLines="None">
                                            <PagerStyle Mode="NumericPages"></PagerStyle>
                                            <ClientSettings EnableRowHoverStyle="true">
                                                <Selecting AllowRowSelect="true" />
                                            </ClientSettings>
                                            <MasterTableView Width="100%" DataKeyNames="Record_Status_ID" AllowMultiColumnSorting="True"
                                                AllowFilteringByColumn="False" ExpandCollapseColumn-Display="True">
                                                <DetailTables>
                                                    <telerik:GridTableView DataKeyNames="ID" Name="Workflow_list" Width="100%" AllowPaging="True" PageSize="5" AlternatingItemStyle-BackColor="AliceBlue">
                                                        <Columns>
                                                          
                                                            <telerik:GridBoundColumn SortExpression="ID" HeaderText="ID#"
                                                                HeaderButtonType="TextButton" DataField="ID" Visible="true">
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn SortExpression="Name" HeaderText="Name" HeaderButtonType="TextButton"
                                                                DataField="Name" UniqueName="Name">
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn SortExpression="Date" HeaderText="Date"
                                                                HeaderButtonType="TextButton" DataField="Date" UniqueName="Date">
                                                            </telerik:GridBoundColumn>
                                                           <telerik:GridTemplateColumn UniqueName="View">
                                                                <ItemTemplate>
                                                                    <asp:LinkButton ID="lnkView" runat="server" CausesValidation="false" CommandArgument='<%# Eval("ID") %>'
                                                                        CommandName="View" Text="View"></asp:LinkButton>
                                                                </ItemTemplate>
                                                                <HeaderStyle Width="10px" />
                                                            </telerik:GridTemplateColumn>
                                                           
                                                           
                                                           
                                                        </Columns>
                                                    </telerik:GridTableView>
                                                </DetailTables>
                                                <ExpandCollapseColumn Visible="True">
                                                </ExpandCollapseColumn>
                                                <Columns>
                                                    <telerik:GridBoundColumn SortExpression="Record_Status_ID" HeaderText="Record_Status_ID"
                                                        HeaderButtonType="TextButton" DataField="Record_Status_ID" Visible="False">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn SortExpression="Status Description" HeaderText="Work Flow Item"
                                                        HeaderButtonType="TextButton" DataField="Description">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn SortExpression="Num" HeaderText="Number of records" HeaderButtonType="TextButton"
                                                        DataField="Num">
                                                    </telerik:GridBoundColumn>
                                                </Columns>
                                            </MasterTableView>
                                        </telerik:RadGrid>


Thank you,
usr9999
Top achievements
Rank 1
 answered on 24 Mar 2011
1 answer
123 views
Hello,

I am using the client object model. I want to force a rebind of the grid back to page 1. I am having trouble setting the page number in the pager back to 1 (if I am on page 2 before the rebind).

This code does not always rebind - typically when already on the first page, but also under other conditions.
tableView.set_currentPageIndex(0, true);

This code rebinds, but does not reset the page number in the pager to page 1 if I was on page 2.
var tableView = $find(radGridPracticesClientID).get_masterTableView();
tableView.rebind();

So I cannot use this:
if (currentPageIndex == 0) { 
    tableView.rebind(); 
else
    // buggy - does not always rebind - e.g. when new results are less than 1 page 
    tableView.set_currentPageIndex(0, true); 
}

Finally, this code is equivalent to tableView.rebind() it always rebinds and gets the results for page 1 but does not set the page number in the pager to 1. The page count IS correct.
            var currentPageIndex = 0;   
            PageMethods.GetPracticesAndCount(currentPageIndex, pageSize, 
              sortExpressions, filterExpressions, installationID, 
              environmentalWeight, regulatoryWeight, 
              publicPerceptionWeight, healthAndSafetyWeight, 
              includeAspects, includeImpacts, checkedCommandIDs, selectedLocationIDs, 
              rebindPracticeGridResult);
        }
  
function rebindPracticeGridResult(result) { 
     var tableView = $find("ctl00_PlaceHolderMain_Practice1_RadGridPractices").get_masterTableView(); 
     tableView.set_dataSource(result.Practices);
     tableView.dataBind();
     tableView.set_virtualItemCount(result.PracticeCount);
}
Maria Ilieva
Telerik team
 answered on 24 Mar 2011
2 answers
166 views

Hello, please help me.

I uses RadFormDecorator and i want to change the font family of button
I apply this css style

  

 

 

 

.RadForm_Sitefinity.rfdButton  input[type="button"].rfdDecorated
{
      font: normal 11px Tahoma, Arial, Sans-serif !important;
}

 

 

it change only font-style and font-size but the font family is not change.
please help me
thank you

 

 

 

 

 

big-O
Top achievements
Rank 1
 answered on 24 Mar 2011
3 answers
75 views
There is a context menu for the controls in a radgrid. Following is a part of client-side script for displaying the menu:
function contextMenu(sender, args)
{
        var evt = args.get_domEvent();
        var td = (evt.srcElement) ? args.srcElement : evt.target;
        var cols = args.get_tableView().get_columns();
        var col = cols[td.parentElement.cellIndex]; //-----> this is undefined
        var index = args.get_itemIndexHierarchical();
        document.getElementById("radGridClickedRowIndex").value = index;
        document.getElementById("radGridClickedColName").value = col.get_uniqueName();
        document.getElementById("radGridModifiedValue").value = td.value;
        //................
}

It is working fine for asp:textbox but not able to get 'CellIndex' for the Radnumerictextbox.
Daniel
Telerik team
 answered on 24 Mar 2011
2 answers
69 views
Hello,

I am having an issue where I have a grid with many columns and am attempting to use the HeaderStyle-Width property in the designer to set the initial column width.  When I do this, the table that contains the grid expands past its width.  Removing the HeaderStyle-Width properties causes each column to be very narrow.  Is there I way that I may control the width of the columns without having the surrounding HTML affected?  I am using contentplaceholders and other placeholders are also affected.

<asp:Content ID="GridContent" ContentPlaceHolderID="GridContent" Runat="Server">
<table border="0" cellpadding="0" cellspacing="0" width="520">
    <tr>
        <td>
            <div>
                <telerik:RadGrid ID="RadGridProgram" runat="server"
                        AutoGenerateColumns="false" AllowSorting="True" AllowPaging="true" Skin="Simple" ClientSettings-Resizing-AllowColumnResize="true"
                        ItemStyle-Wrap="false" Width="500" HeaderStyle-Wrap="false" PageSize="10"
                        OnNeedDataSource="RadGridProgram_NeedDataSource" OnItemCommand="RadGridProgram_ItemCommand">
                        <PagerStyle Mode="NumericPages" />
                        <ClientSettings>
                            <Scrolling AllowScroll="true" UseStaticHeaders="true"  />
                        </ClientSettings>
                        <MasterTableView TableLayout="Fixed" AllowMultiColumnSorting="true" DataKeyNames="ProgramID" ShowFooter="false" PagerStyle-AlwaysVisible="false" >
                            <NoRecordsTemplate>
                                <asp:Label ID="lblMsg" runat="server" Text="No Records found"></asp:Label>
                            </NoRecordsTemplate>
                            <Columns>
                                <telerik:GridButtonColumn ButtonType="LinkButton" HeaderText="Edit" CommandName="EditProgram" UniqueName="Edit" Text="Edit" HeaderStyle-Width="40" />
                                <telerik:GridBoundColumn HeaderText="Program ID" HeaderButtonType="TextButton" DataField="ProgramID" HeaderStyle-Width="80" />
                                <telerik:GridBoundColumn HeaderText="Prog. Collection. ID" HeaderButtonType="TextButton" DataField="ProgramId" Display="false" />
                                <telerik:GridBoundColumn HeaderText="Program Collection" HeaderButtonType="TextButton" DataField="ProgramCollection.ProgramName" HeaderStyle-Width="200" />
                                <telerik:GridBoundColumn HeaderText="Client ID" HeaderButtonType="TextButton" DataField="ClientId" Display="false" />
                                <telerik:GridBoundColumn HeaderText="Client" HeaderButtonType="TextButton" DataField="Client.ClientName" HeaderStyle-Width="150" />
                                <telerik:GridBoundColumn HeaderText="Program Name" HeaderButtonType="TextButton" DataField="ProgramName" HeaderStyle-Width="200" />
                                <telerik:GridBoundColumn HeaderText="Program Code" HeaderButtonType="TextButton" DataField="ProgramCode" HeaderStyle-Width="100" />
                                <telerik:GridBoundColumn HeaderText="Description" HeaderButtonType="TextButton" DataField="ProgramDescription" HeaderStyle-Width="300" />
                                <telerik:GridBoundColumn HeaderText="Program Type Id" HeaderButtonType="TextButton" DataField="ProgramTypeId" HeaderStyle-Width="200" Display="false" />
                                <telerik:GridBoundColumn HeaderText="Program Type" HeaderButtonType="TextButton" DataField="ProgramType.ProgramTypeCode" HeaderStyle-Width="100" />
                                <telerik:GridBoundColumn HeaderText="Domain Exp. Date" HeaderButtonType="TextButton" DataField="DomainExpDateText" HeaderStyle-Width="100" />
                                <telerik:GridBoundColumn HeaderText="SSL Exp. Date" HeaderButtonType="TextButton" DataField="SSLExpDateText" HeaderStyle-Width="100" />
                                <telerik:GridBoundColumn HeaderText="Domain Name" HeaderButtonType="TextButton" DataField="DomainName" HeaderStyle-Width="250" />
                                <telerik:GridBoundColumn HeaderText="IPAddress" HeaderButtonType="TextButton" DataField="IPAddress" HeaderStyle-Width="250" />
                                <telerik:GridBoundColumn HeaderText="PM Name" HeaderButtonType="TextButton" DataField="PMName" HeaderStyle-Width="100" />
                                <telerik:GridBoundColumn HeaderText="Developer Name" HeaderButtonType="TextButton" DataField="DeveloperName" HeaderStyle-Width="100" />
                                <telerik:GridBoundColumn HeaderText="Job Number" HeaderButtonType="TextButton" DataField="JobNumber" HeaderStyle-Width="100" />
                                <telerik:GridBoundColumn HeaderText="Adverse Events" HeaderButtonType="TextButton" DataField="HasAdverseEvents" HeaderStyle-Width="100" />
                                <telerik:GridBoundColumn HeaderText="Pharmacy Lookup" HeaderButtonType="TextButton" DataField="HasPharmacyLookup" HeaderStyle-Width="100" />
                                <telerik:GridBoundColumn HeaderText="Fax" HeaderButtonType="TextButton" DataField="Fax" HeaderStyle-Width="100" />
                            </Columns>
                        </MasterTableView>
                </telerik:RadGrid>
            </div>
        </td>
    </tr>
</table>
</asp:Content>


Thanks,
Tom
Top achievements
Rank 1
 answered on 24 Mar 2011
1 answer
92 views
We are using Telerik.Charting.dll  in our SharePoint 2007 solution, we recently upgraded the solution to VS 2010 and  SP 2010, and we want to upgrade the Telerik.Charting.dll to current version which is "RadControls for ASP.NET Q1 2009" , could you please guid us in upgrading, we have upgraded the "Telerik.Web.UI.dll" file.

Thanks,
Kartheek
Giuseppe
Telerik team
 answered on 24 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?