Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
121 views
I have a bit of java script on a master page that is checking a user control nested inside a grid (edit mode) that ensures the user has at-least selected one of the template items in a drop-down list.  
The template in the combo box contains a Check box and label....

If the user tries to submit the edited or new record, a custom validator with a client side event fire and should check to see if they user actually selected at-least 1 of the template check boxes, otherwise it displays an error and the validation control stops the post back to the server...

So if I run this in IE, I have no problems... But it does not seem to validate in chrome, safari and firefox.. I suspect it has to do with the line of code:
items.getItem(i).get_element().innerHTML.indexOf("CHECKED") > 0


Now I can get it  to work if I use a server postback, but I would like to avoid a trip to the server... (see server method c# at the end of the post...)

MASTER PAGE Javascript
<script type="text/javascript">
         function ClientListBoxItemsCountValidate(source, arguments) {
            var listbox = $find(source.controltovalidate);
            var itemsCount = listbox.get_items().get_count();
  
            if (itemsCount < 1)
                arguments.IsValid = false;
            else if (itemsCount > 0)
                arguments.IsValid = true;
        }
  
        function ClientComboCountValidate(source, arguments) {
            var comboBox = $find(source.controltovalidate);
            var items = comboBox.get_items();
  
            for (var i = 0; i < items.get_count(); i++) {
                if (items.getItem(i).get_element().innerHTML.indexOf("CHECKED") > 0) {
                    arguments.IsValid = true;
                } else {
                    arguments.IsValid = false;
                 }
             }
        }      
     </script>


ComboBox and Validator in usercontrol nested in a radgrid 
<telerik:RadComboBox ID="RadComboDepartments" runat="server" DataTextField="DepartmentName"
    DataValueField="DepartmentUid" EmptyMessage="Please select" CausesValidation="True">
        <ItemTemplate>
            <asp:CheckBox ID="CheckBox" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.DepartmentName") %>' />
         </ItemTemplate>
 </telerik:RadComboBox>
     <asp:CustomValidator ID="CustomValidator2" ValidateEmptyText="true" ControlToValidate="RadComboDepartments"
         Display="Dynamic" ClientValidationFunction="ClientComboCountValidate" ErrorMessage="<br />One department must be selected"
         CssClass="Error" runat="server"  />



Not the desired solution:  Server Side Validation...
protected void CustomValidator2_ServerValidate(object source, ServerValidateEventArgs args)
        {
            foreach (RadComboBoxItem item in RadComboDepartments.Items)
            {
                CheckBox chk = (CheckBox)item.FindControl("CheckBox");
                if (chk.Checked)
                {
                    args.IsValid = true;
                    return;
                }
            }
 
            args.IsValid = false;
        }


Nencho
Telerik team
 answered on 25 Jan 2013
4 answers
133 views
Hi,

I am having a RadGrid on my page which is bounded in client-side to populate retrieving data from a WCFAjaxEnabledService.
Everything works well to populate data., but the HeaderContextmenu operations(like filtering and sorting etc.) are not working.

Also while sorting operation through the HeaderContextMenu, it does not find the MasterTableView for the particular grid while trying to populating the grid again after the reloading and nothing happens with filter through HeaderContextMenu operation.

Do anybody is having any suggestions regarding this, Please help me ?

Can i handle the click event of this HeaderContestMenu on client-side ?

Thanks in advance..
Vasil
Telerik team
 answered on 25 Jan 2013
1 answer
101 views
How can I set the BannersPath by using javascript?
var r1 = $find("<%= RadRotator1.ClientID %>");

 

if (r1 != null) r1.BannersPath = "../../Photos/" + Homes[homeindex].replace(" ", "");

<telerik
:RadRotator ID="RadRotator1" runat="server" Width="370px" Height="219px" RotatorType="SlideShowButtons" BannersPath="~/Photos/Bayview"

 

ItemHeight="219px" ItemWidth="330px" FrameDuration="3000" ScrollDirection="Left, Right">

Thanks

 

 

Slav
Telerik team
 answered on 25 Jan 2013
8 answers
98 views
I facing problem in opera while selecting multiple contacts on radgrid. While holding ctrl key it always opens new window/tab of ajaxMap. As on single click in radgrid; i am showing addresses of contacts on AjaxMap which is implemented in my page. And on multiple clicks on radgrid it shows multiple addresses of contacts on Ajaxmap. But in opera it opens ajaxMap in new window instead of showing contact address on Ajaxmap in same page where i implement it.   Except opera it works fine in all browsers. But why i facing this issue in opera. Can anyone please help me.
Vasil
Telerik team
 answered on 25 Jan 2013
1 answer
104 views
Hi,

    I am using radchart in my page. i have to show html table inside of radchart

How to do this?????????

Please let me know............ Urgent


Thanks,
Prasanna
Yavor
Telerik team
 answered on 25 Jan 2013
2 answers
142 views
How to find the treelistboundcolumn value in void function call

<telerik:RadTreeList ID="RadTreeListWork" runat="server" OnNeedDataSource="RadTreeListWork_NeedDataSource"
                        ParentDataKeyNames="WorkParentId" DataKeyNames="WorkId" AutoGenerateColumns="False"
                        OnItemDataBound="RadTreeListWork_ItemDataBound" EditMode="PopUp" AllowMultiItemEdit="False"
                        Culture="(Default)" GridLines="None" IsItemInserted="false" ShowOuterBorders="False"
                        Width="900px">
                        <%--AllowPaging="true" PageSize="10"--%>
                        <Columns>
                            <telerik:TreeListBoundColumn DataField="WorkId" HeaderText="WorkId" ReadOnly="true"
                                UniqueName="WorkId" HeaderStyle-Width="75px" ForceExtractValue="Always" Visible="false" />
                            <telerik:TreeListBoundColumn DataField="WorkParentId" HeaderText="WorkParentId" HeaderStyle-Width="65px"
                                UniqueName="WorkParentId" ReadOnly="true" ForceExtractValue="Always" Visible="false" />
                            <telerik:TreeListBoundColumn DataField="WorkName" HeaderText="Name" UniqueName="WorkName"
                                HeaderStyle-Width="70px" />
                            <telerik:TreeListBoundColumn DataField="WorkDescription" HeaderText="Description"
                                UniqueName="WorkDescription" HeaderStyle-Width="170px" />


.cs

foreach (TreeListDataItem item in RadTreeListWork.Items)
               {
                   dtl1 = new xmlDSPrepareClaimDtl();
 
                   int? id = (int?)item.GetDataKeyValue("WorkId");
                   int? Parentid = (int?)item.GetDataKeyValue("WorkParentId");

i find like that id is coming but parent id and other things are not come

Thanks Advance,
Mohamed.
mohamed
Top achievements
Rank 1
 answered on 25 Jan 2013
3 answers
97 views
My application contains a datagrid. Each record have different values but buttons(Edit button) with same name against each record. how to click a particular button corresponding to a particular record using test studio
Princy
Top achievements
Rank 2
 answered on 25 Jan 2013
3 answers
94 views
Hello,

I am using radgrid with pop up edit form ,Edit form is opening on double click of row. 
radfrid has "status" column inside it

following are the status
Approved , verified , declined.

so I want to open edit form only if there is decline status so user can resubmit the record
 if  status is approved and verified  I don't want to open edit form on double click.

Please give any suggestion.

Thanks and regards,
Amit

Shinu
Top achievements
Rank 2
 answered on 25 Jan 2013
0 answers
147 views
//The code will generate RadTreeNode. The node has multiple subnodes.
EntityCollection
<MusicEntity> collection = GetMusicData(); EntityCollection<MusicEntity> collection = GetMusicData(); treMusic.Nodes.Clear(); ArrayList ptnodes = new ArrayList(); RadTreeNode nodeWorkplane = new RadTreeNode(p.PWork); RadTreeNode nodeUser = new RadTreeNode(p.UserProject.Items[0].UserName); RadTreeNode musicgroupnode = new RadTreeNode(p.MusicSubGroup.MusicGroup.Name, String.Empty); RadTreeNode musicsubgroupnode = new RadTreeNode(p.MusicSSubGroup.Name, String.Empty); RadTreeNode musicnode = new RadTreeNode(p.MusicTitle); musicsubgroupnode.Nodes.Add(musicnode); musicgroupnode.Nodes.Add(musicsubgroupnode); nodeUser.Nodes.Add(musicgroupnode); nodeUser.Nodes.Add(nodeWorkplane); pgnodes.Add(nodeUser); foreach (RadTreeNode pg in ptnodes) { treMusic.Nodes.Add(pg); }

From the code above, this is treenode that will display.

User1
  -> Music Group node 1
    -> Music SubGroup node 1
         -> Music Node 1

  -> Node Workplane 1

User1
  -> Music Group node 2
     -> Music SubGroup node 2
         -> Music Node 2
   -> Node Workplane 2

My question how i can combine user1 in one node. Thank you for helps. so the following node that i want to achieve:

User1
      -> Music Group node 1
        -> Music SubGroup node 1
             -> Music Node 1


      -> Music Group node 2
         -> Music SubGroup node 2
             -> Music Node 2

      -> Node Workplane 1
      -> Node Workplane 2
Mark de Torres
Top achievements
Rank 1
 asked on 25 Jan 2013
1 answer
199 views
Hi,

I have a requirement in my project that i have to export the data from RadGrid to excel.

This can be achieved by using the following command:

.MasterTableView.ExportToExcel();

But i want a few rows in the excel (which is exported) grouped by means of expand and collapse feature to the left of the row.

Please find attached the screenshot.

Thanks in advance

Regards, Vasanth
Shinu
Top achievements
Rank 2
 answered on 25 Jan 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?