Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
110 views
I am not sure this should actually be here in Grid or Ajax manager. I have a Grid and an Ajax manager control. I insert into the grid and, as expected, the whole page does not refresh yet the grid does. (Very Nice).

Now I have run into an issue where I have had to add a SQLDataSource and FormView on the page that needs to be updated after the insert into the Grid. I can force the page to refresh and have the FormView update but this sort of defeats the purpose of using the Ajax control to prevent a full page refresh.

I have tried to have the SQLDataSource and FormView refresh using both the Gridss ItemInserted and/or the Grid's SQLDataSource Inserted to force a rebind of the FormView. Niether worked.

Is there a way to have the FormView rebind/refresh after the Grid Insert has occured?

Here is my AJAX code:

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript" language="javascript">
        function refreshGrid(arg) {
            if (!arg) {
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
            }
        }
    </script>
</telerik:RadCodeBlock>


<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
         <telerik:AjaxSetting AjaxControlID="RadCodeBlock1">
             <UpdatedControls>
                 <telerik:AjaxUpdatedControl ControlID="rgd_Labor" UpdatePanelHeight="" />
                 <telerik:AjaxUpdatedControl ControlID="rgd_Materials" UpdatePanelHeight="" />
             </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
    </telerik:RadAjaxManager>







Jayesh Goyani
Top achievements
Rank 2
 answered on 29 Feb 2012
3 answers
136 views
Hi.
I have a RadDateTimePicker in a grid.How i can compare SelectedDate(DateTime type!)  with today's date?
My code:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            GridEditableItem item = e.Item as GridEditableItem;
            RadDateTimePicker startDate = (RadDateTimePicker)item.FindControl("startDate");
 
            TableCell cell = (TableCell)start.Parent;
 
            CompareValidator CV1 = new CompareValidator();
            CV1.ErrorMessage = "*";
            CV1.ControlToValidate = startDate.ID;
            CV1.Operator = ValidationCompareOperator.GreaterThanEqual;
            CV1.ValueToCompare = DateTime.Now.ToString();
            cell.Controls.Add(CV1);
 
            }
      }
Please help,
Thanks.
xvikx
Top achievements
Rank 1
 answered on 29 Feb 2012
1 answer
186 views
I want to find the Setup Offline of RadControls For AspNet Ajax (Free Trial Q1 2012). Can you help me - show for me link download RadControls for aspnet ajax setup offline free trial Q1 2012?
Princy
Top achievements
Rank 2
 answered on 29 Feb 2012
2 answers
276 views
Hi,
     Am using Footer in Rad Grid for summing up my total column.
Now the total is showing for the entire datasource which i set for that grid.
All i needed is to display the summation , for the current page records alone (say for the current 10 records if i set to pagesize as 10).
Is there any way to implement this feature ?



Regards,
Karthikeyan G
Karthi Keyan
Top achievements
Rank 1
 answered on 29 Feb 2012
4 answers
302 views

I have a project with 2 types of users. I want only the Supervisors to be able to view the "User Management" page. This page is a child node of my rad menu and it seems that I can only hide the title node or I get this error:

"Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"

How do I hide just some of the pages in the child nodes?


    <siteMapNode title="Users" roles="Supervisor" target="_blank">
        <siteMapNode url="UsersOnline.aspx" title="Users Online" target="_blank" />
        <siteMapNode url="UserManagement.aspx" title="User Management" target="_blank" />
    </siteMapNode>

    Protected Sub RadMenu1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadMenuEventArgs) Handles RadMenu1.ItemDataBound
        Dim node As SiteMapNode = TryCast(e.Item.DataItem, SiteMapNode)

        If Not String.IsNullOrEmpty(node("target")) Then
            e.Item.Target = node("target")
        End If
        If e.Item.Text = "User Management" AndAlso msUserType = "Standard" Then
            RadMenu1.Items.Remove(e.Item)
        End If
    End Sub

Princy
Top achievements
Rank 2
 answered on 29 Feb 2012
3 answers
68 views
hi,

I wanted to know hex code of Hay's hover and selected css class and I wanted to use it with forest skin. Right now Forest hover and selected color is Orange and I wanted to change that to Hay's green..

Where do I find the css file for Hay?
Princy
Top achievements
Rank 2
 answered on 29 Feb 2012
3 answers
262 views
I have tried all the demos and examples and nothing has worked!
Markup:
<telerik:RadGrid ID="grvUsers"   
                     runat="server"   
                     AutoGenerateColumns="False"   
                     GridLines="None" 
                     Skin="Office2007"   
                     OnNeedDataSource="grvUsers_NeedDataSource"   
                     OnUpdateCommand="grvUsers_UpdateCommand"   
                     AllowPaging="True"   
                     AllowSorting="True"   
                     ShowGroupPanel="True" OnItemCommand="grvUsers_ItemCommand" OnEditCommand="grvUsers_EditCommand">  
        <MasterTableView AllowAutomaticInserts="True" CommandItemDisplay="Top">  
            <RowIndicatorColumn Visible="False">  
                <HeaderStyle Width="20px" /> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn Resizable="False" Visible="False">  
                <HeaderStyle Width="20px" /> 
            </ExpandCollapseColumn> 
            <Columns> 
                <telerik:GridEditCommandColumn> 
                </telerik:GridEditCommandColumn> 
                <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" UniqueName="LastName">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" UniqueName="FirstName">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="UserLevel" HeaderText="User Rights" UniqueName="Rights">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="Enabled" HeaderText="Enabled" UniqueName="Enabled">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="UserInfoUID" UniqueName="UserInfoUID" Visible="False">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="UserName" UniqueName="UserName" Visible="False">  
                </telerik:GridBoundColumn> 
            </Columns> 
            <EditFormSettings EditFormType="Template" CaptionFormatString="Edit the information for &lt;%# Bind('FirstName') %&gt; &lt;%# Bind('LastName') %&gt;" > 
                <EditColumn UniqueName="EditCommandColumn1"></EditColumn> 
                <FormTemplate> 
                    <table style="width: 568px">  
                        <tr> 
                            <td style="width: 131px">  
                                Last Name</td> 
                            <td style="width: 160px">  
                                <telerik:RadTextBox ID="txtEdit_LastName" runat="server" MaxLength="50" Text="<%# Bind('LastName') %>">  
                                </telerik:RadTextBox></td>  
                            <td> 
                                <asp:RequiredFieldValidator ID="rfvEdit_LastName" runat="server" ControlToValidate="txtEdit_LastName" 
                                    ErrorMessage="Please enter the users last name" ValidationGroup="Edit">*</asp:RequiredFieldValidator> 
                            </td> 
                            <td style="width: 174px">  
                                First Name</td> 
                            <td style="width: 156px">  
                                <telerik:RadTextBox ID="txtEdit_FirstName" runat="server" MaxLength="50" Text="<%# Bind('FirstName') %>">  
                                </telerik:RadTextBox></td>  
                            <td> 
                                <asp:RequiredFieldValidator ID="rfvEdit_FirstName" runat="server" ControlToValidate="txtEdit_FirstName" 
                                    ErrorMessage="Please enter the users first name" ValidationGroup="Edit">*</asp:RequiredFieldValidator></td>  
                        </tr> 
                        <tr> 
                            <td style="width: 131px">  
                                Username</td> 
                            <td style="width: 160px">  
                                <telerik:RadTextBox ID="txtEdit_Username" runat="server" Text="<%# Bind('Username') %>">  
                                </telerik:RadTextBox></td>  
                            <td> 
                                <asp:RequiredFieldValidator ID="rfvEdit_UserName" runat="server" ControlToValidate="txtEdit_Username" 
                                    ErrorMessage="Please enter the users 'Username'" ValidationGroup="Edit">*</asp:RequiredFieldValidator></td>  
                            <td style="width: 174px">  
                            </td> 
                            <td style="width: 156px">  
                            </td> 
                            <td> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td style="width: 131px; height: 27px">  
                                Password</td> 
                            <td style="width: 160px; height: 27px">  
                                <telerik:RadTextBox ID="txtEdit_Password" runat="server" InvalidStyleDuration="100" Text="<%# Bind('Password') %>" Width="125px" EmptyMessage="************" MaxLength="20" TextMode="Password">  
                                </telerik:RadTextBox></td>  
                            <td style="height: 27px">  
                            </td> 
                            <td style="width: 174px; height: 27px">  
                                Password</td> 
                            <td style="height: 27px; width: 156px;">  
                                <telerik:RadTextBox ID="txtEdit_ConfirmPassword" runat="server" InvalidStyleDuration="100" Text="<%# Bind('Password') %>" TextMode="Password" Width="125px" EmptyMessage="***********" MaxLength="20">  
                                </telerik:RadTextBox> 
                            </td> 
                            <td style="height: 27px">  
                            </td> 
                        </tr> 
                        <tr> 
                            <td> 
                                Rights</td> 
                            <td> 
                                <asp:DropDownList ID="cmbEdit_Rights" runat="server" Width="119px" SelectedValue='<%# Bind("UserLevel") %>'>  
                                    <asp:ListItem>User</asp:ListItem> 
                                    <asp:ListItem>Admin</asp:ListItem> 
                                </asp:DropDownList></td>  
                            <td> 
                            </td> 
                            <td> 
                                Enabled</td> 
                            <td> 
                                <asp:DropDownList ID="cmbEdit_Enabled" runat="server" Width="119px" SelectedValue='<%# Bind("Enabled") %>'>  
                                    <asp:ListItem Value="True">Yes</asp:ListItem> 
                                    <asp:ListItem Value="False">No</asp:ListItem> 
                                </asp:DropDownList></td>  
                            <td> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td colspan="6">  
                            </td> 
                        </tr> 
                        <tr> 
                            <td align="right" colspan="6">  
                                <asp:LinkButton ID="lnkEdit_Cancel" runat="server" CausesValidation="False" CommandName="Cancel" Text='<%# (Container is GridEditFormInsertItem) ? "Done" : "Cancel" %>' >Cancel</asp:LinkButton>&nbsp;  
                                &nbsp;<asp:LinkButton ID="lnkEdit_Done" runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' Text='<%# (Container is GridEditFormInsertItem) ? "Save" : "Save Changes" %>'></asp:LinkButton> 
                                &nbsp;  
                            </td> 
                        </tr> 
                        <tr> 
                            <td align="center" colspan="6">  
                                <asp:Label ID="lblUID" runat="server" Text="<%# Bind('UserInfoUID') %>" Visible="False"></asp:Label> 
                                <asp:Label ID="lblEdit_Message" runat="server"></asp:Label> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td align="center" colspan="6" style="height: 21px">  
                                <asp:ValidationSummary ID="vsEdit" runat="server" ValidationGroup="Edit" /> 
                            </td> 
                        </tr> 
                    </table> 
                </FormTemplate> 
                <PopUpSettings ScrollBars="None" /> 
            </EditFormSettings> 
            <CommandItemSettings AddNewRecordText="Add new user" /> 
            <PagerStyle AlwaysVisible="True" HorizontalAlign="Left" Mode="Slider" /> 
        </MasterTableView> 
        <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" AllowDragToGroup="True">  
            <Selecting AllowRowSelect="True" /> 
        </ClientSettings> 
    </telerik:RadGrid> 

Now, heres where it works and doesn't. If I have this line (similar for the second drop down):
 <asp:DropDownList ID="cmbEdit_Enabled" runat="server" Width="119px" SelectedValue='<%# Bind("Enabled") %>'>  
                                    <asp:ListItem Value="True">Yes</asp:ListItem> 
                                    <asp:ListItem Value="False">No</asp:ListItem> 
                                </asp:DropDownList> 
when I go into edit mode, the drop downs are populated with the current values which is a project requirement.  But when I click the 'Add new user', I get this error:

'cmbEdit_Rights' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value

If I leave out the <%# Bind("UserLevel") %> I can insert and update, but I loose the requirement of displaying the current value which I need.


Please help asap!
Shinu
Top achievements
Rank 2
 answered on 29 Feb 2012
2 answers
355 views
Hello there,

I have a RadListView displaying data in pages of 4 using the RadDataPager:
              <telerik:RadDataPager ID="UnlocatedCasesPager"  
                                                      runat="server"  
                                                      PagedControlID="UnlocatedCasesListView"  
                                                      PageSize="4"
                                    <Fields> 
                                        <telerik:RadDataPagerButtonField FieldType="FirstPrev" /> 
                                        <telerik:RadDataPagerButtonField FieldType="Numeric" PageButtonCount="3" /> 
                                        <telerik:RadDataPagerButtonField FieldType="NextLast" /> 
                                    </Fields> 
                                </telerik:RadDataPager> 

I cannot work out how to hide the pager when there are 4 or less items being displayed in my list view. I have tried using the FindControl method of the ListView to get hold of the pager and hide it if necessary in various places (OnDataBound event and when I actually assign the datasource of the ListView) but that always returns null. The pager is contained in the <LayoutTemplate>.

Thanks very much, Carl
Daryl
Top achievements
Rank 1
 answered on 29 Feb 2012
3 answers
165 views
I was referring telerik demo for such functionality - http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/templates/defaultcs.aspx

The only change is i am using treeview with checkbox in RadComboBox. I wanted to display checked items of combobox as comobobox text with comma on collapse.

How to do that?
Teoman
Top achievements
Rank 1
 answered on 29 Feb 2012
4 answers
112 views
Hi,
We have treeview with checkbox in combobox.We dont have any problem with chrome and firefox but combobox doesnt closed when we focused out of the control in IE.

<telerik:RadComboBox ID="cbxDepartments" runat="server" DataTextField="DEPNAME" DataValueField="DEPID"
                                ExpandAnimation-Type="None" CollapseAnimation-Type="None" OnClientDropDownClosing="OnClientDropDownClosing"
                                AllowCustomText="True" EmptyMessage="-- seçiniz --">
                                <ItemTemplate>
                                    <div id="div1">
                                        <telerik:RadTreeView ID="tvDepartments" runat="server" DataTextField="DEPNAME" DataValueField="DEPID"
                                            DataFieldParentID="SUBDEPID" DataFieldID="DEPID" Height="140px" CheckBoxes="true">
                                        </telerik:RadTreeView>
                                    </div>
                                </ItemTemplate>
                                <Items>
                                    <telerik:RadComboBoxItem Text="" />
                                </Items>
                                <ExpandAnimation Type="Linear"></ExpandAnimation>
                                <CollapseAnimation Type="None"></CollapseAnimation>
                            </telerik:RadComboBox>

 <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function OnClientDropDownClosing(sender, args) {
                //            if (args.get_node().get_level() == 0)
                //            {
                //                args.set_cancel(true);
                //            }
                //            else {
                var item = sender.get_items().getItem(0); // Get the first RadComboBoxItem
                var treeView = item.findControl('tvDepartments'); // Find your RadTreeView
                var checkedNodes = treeView.get_checkedNodes(); // Retrieve the checked items in the RadTreeView

                var newText = '';
                checkedNodes.forEach(function (node) {  // Loop through the checked nodes. Requires jQuery!
                    if (newText != '') { newText += ', '; }
                    newText += node.get_text();
                });
                var comboBox = $find("<%= cbxDepartments.ClientID %>");
                comboBox.set_text(newText); // Set the RadComboBox text
                if ($.browser.msie) { // IE sometimes takes two tries for it to respond to new text
                    comboBox.set_text(newText);
                    //                }
                }
            }
        </script>


Teoman
Top achievements
Rank 1
 answered on 29 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?