Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
79 views
Hi,

I am using a hierarchical rad grid and saving some grid's statuses (filter function,sort expression,page size....) according to users.
I need to save and reload the column order of grid (After drag and drop columns)
I can save column order as a pipe separated string by using column indexes in to a xml string.

But when reloading the column order it gives exception that says mismatch with viewstate.
Can anyone give me a solution to achieve this task.

Regards,
Madu
madu
Top achievements
Rank 1
 answered on 04 Jan 2011
1 answer
105 views
Searched the forum, but couldn't find anything.

Is there a way to make to edit form popup window resizable?
I don't see any property under EditFormSettings or PopUpSettings to set this value.

I basically need the user to be able to increase or decrease the size of the popup.

Thanks
Shinu
Top achievements
Rank 2
 answered on 04 Jan 2011
5 answers
237 views
Dear Telerik,

     Am using RadTimePicker,RadDateTimePicker and RadDatePicker. I cant find the control in dynamically. I need DisplayDateFormat from database side. If i find the control is RadTimePicker, that ll execute on all loops like that control is RadTimePicker and RadDateTimePicker and RadDatePicker. so i cant set DisplayDateFormat properly. pls solve this problem.

                     if (Ctrl is RadDatePicker)
                {
                    ((RadDatePicker)Ctrl).DateInput.DisplayDateFormat = "dd/MM/yyyy";
                }
                if (Ctrl is RadTimePicker)
                {
                    ((RadTimePicker)Ctrl).DateInput.DisplayDateFormat = "hh:mm tt";
                }
                if (Ctrl is RadDateTimePicker)
                {
                    ((RadDateTimePicker)Ctrl).DateInput.DisplayDateFormat="dd/MM/yyyy hh:mm tt "
                }
vinoth sansar
Top achievements
Rank 2
 answered on 04 Jan 2011
5 answers
664 views
Hello!
I'd been searching for a couple of days to find a solution to what is think is a "simple" problem, that due to my lack of knowledge is toooo hard to solve it without help.
What i need to accomplish is:
Open a RadWindow with my login page, 
Get the login and password
Authenticate
-if succeed: redirect
-if fails: display a message ( i have label for that purpose) and keep the RadWindow open.

My problem is that i can't find a way to process the authentication and automatically close the window and redirect.
Because client-side functions run before server-side, i can't perform the authentication in my db and then execute the JavaScript functions with the same button. I know I can look for a javascript snippet to perform the authentication, but i don't want to take that path 'cause at this point i'm blind to javascript. so i want to reduce it at the very minimum possible. I'd tried the techniques to execute JS functions from code-behind with no luck. Even run sever-side functions from JS but i just can't make it work.
What i have so far:
Parent Page
<script language="javascript" type="text/javascript">
        function OpenLogin()
         {
           var wnd = $find("<%=dlgLogin.ClientID%>");
                wnd.setUrl("Login.aspx");
                wnd.show();
            }
            function IsOk(wnd, Arg) {
               var args = Arg.get_argument();
                if (args) {
                    window.location = "CustomerStatus.aspx";
                }
            }     
    </script>
<script language="javascript" type="text/javascript">
        function OpenLogin()
         {
           var wnd = $find("<%=dlgLogin.ClientID%>");
                wnd.setUrl("Login.aspx");
                wnd.show();
            }
            function IsOk(wnd, Arg) {
               var args = Arg.get_argument();
                if (args) {
                    window.location = "CustomerStatus.aspx";
                }
            }    
    </script>

Child Page aspx
<script language="javascript" type="text/javascript">
    
    function GetRadWindow() {
        var oWindow = null;
        if (window.radWindow) oWindow = window.radWindow;
        else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
        return oWindow;
    }
    function CancelWindow() {
       var wnd = GetRadWindow();
        wnd.close();
    }
    function CloseWndw() {
        var arg = document.getElementById("txtIsOk").value;
        if (arg) {
            var wnd = GetRadWindow();
            wnd.close(arg);
        }
    }
    function Waiting(s, e)
        {
            Callback.PerformCallback();
            LPWaitConn.Show();
 
        }
                       
</script>

The  hidden-Field and RadButtons
 <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
       
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
 
<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
        
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
<asp:HiddenField ID="txtIsOk" runat="server" />
 <telerik:RadButton ID="btnLogin" runat="server" Text="Submit" Style="z-index: 1;
                left: 243px; top: 134px; position: absolute; height: 19px" BackColor="Transparent"
                Font-Names="Verdana" Font-Size="10pt" ForeColor="#84DA2E" SkinID="Black" OnClientClicking="Waiting"
                OnClick="btnLogin_Click" OnClientClicked="CloseWndw">
            </telerik:RadButton>
             
            <telerik:RadButton ID="btnCancel" runat="server" Text="Cancel" Style="z-index: 1;
                left: 180px; top: 134px; position: absolute; height: 19px" BackColor="Transparent"
                Font-Names="Verdana" Font-Size="10pt" ForeColor="#84DA2E" Font-Bold="True" Skin="Black"
                EnableViewState="False" OnClientClicked="CancelWindow">
            </telerik:RadButton>
</ContentTemplate>
    </asp:UpdatePanel>

<script language="javascript" type="text/javascript">
        function OpenLogin()
         {
           var wnd = $find("<%=dlgLogin.ClientID%>");
                wnd.setUrl("Login.aspx");
                wnd.show();
            }
            function IsOk(wnd, Arg) {
               var args = Arg.get_argument();
                if (args) {
                    window.location = "CustomerStatus.aspx";
                }
            }     
    </script>
Code-Behind
Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogin.Click
       Dim strCon As String = String.Empty
       Dim cnn As SqlConnection
 
       If Me.txtIsOk.Value.Length > 0 Then Exit Sub 'Because of the forced postback this is avoid more than one execution
 
       If Me.txtUser.Text.Length > 0 AndAlso Me.txtPass.Text.Length > 0 Then
           strCon = "Data Source=MyServer;Initial Catalog=MyDb;User Id=" & Me.txtUser.Text & ";Password=" & Me.txtPass.Text & ";"
           cnn = New SqlConnection(strCon)
           Try
               cnn.Open()
               Me.txtIsOk.Value = "Yes"
           Catch ex As SqlException
               Me.lblWarning.Text = "Wrong Login or Password"
               Me.lblWarning.Visible = True
           Catch ex1 As Exception
               Me.lblWarning.Text = "Wrong Login or Password"
               Me.lblWarning.Visible = True
           Finally
               cnn.Close()
               cnn.Dispose()
           End Try
       End If
   End Sub
The problem with my code is that i have to click twice in the "btnLogin".
In the first click everything will run, but the client-side will execute first and nothing will happen in that side. At the same time if credentials are ok the hidden field will be populated.
In the second click: Again everything will run this time as expected.

For any help
Thanks in advance




Jet
Top achievements
Rank 2
 answered on 04 Jan 2011
2 answers
128 views
Hi All,

Please Please Help ....

I have to update data from Grid.
I have added GridEditCommandColumn in RadGrid. When I browse to Edit data and Click Update data not change in both RadGrid and Database.
Please advice what properties or event I must add?

On the same page I have added (VisualStudio) GridView and do as I did in RadGrid, use same datasourceControl as RadGrid used, updating data worked fine at GridView.

This very simple, updating one by one record I still cannot do it  :(   ...  The actually program I want to do is user may update more than one records, the update data will be affect on RadGrid only, data will just save into database when user click save button.

Any idea please please ...

Thanks and Best Regards....
Naunton
Top achievements
Rank 1
 answered on 04 Jan 2011
1 answer
119 views
I have a user control with a RadListView, which contains a RadSlider and RadToolTip control like this:

<telerik:RadListView ID="myListView" runat="server" >
        <LayoutTemplate>
            <asp:Panel ID="RadListViewLayoutPanel" runat="server">
                <div class="container">
                    <asp:PlaceHolder ID="ItemPlaceHolder" runat="server"></asp:PlaceHolder>
                </div>
                <div class="slider">
                    <telerik:RadSlider ID="mySlider" runat="server" >
                    </telerik:RadSlider>
                    <telerik:RadToolTip ID="myToolTip" runat="server" Position="TopLeft" >
                    </telerik:RadToolTip>
                </div>
            </asp:Panel>
        </LayoutTemplate>
...
...

How do I find the ToolTip and Slider control in my JS? Note that I can't simple put the JS in the LayoutTemplate since this is a user control that lives on a page and for some reason the JS wouldn't get executed if I put in directly in the LayoutTemplate.

I was able to get the RadListView control by doing $find("<%=myUserControlThatHoldsTheListView.FindControl("myListView").ClientID %>") but how do I get the controls inside?

Thanks.

not
Top achievements
Rank 1
 answered on 04 Jan 2011
2 answers
62 views
 I have a grid in an ajaxpanel:

 

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="100%" Width="100%" LoadingPanelID="RadAjaxLoadingPanel1">
  
<table><tr><td valign="top">
  
<telerik:RadGrid ID="radGridABC" runat="server" Width="800px" AutoGenerateColumns="False" GridLines="None" OnItemDataBound="radGridABC_ItemDataBound" Skin="MainGrid" EnableEmbeddedSkins="false" PageSize="10" AllowPaging="true">
  
<PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
  
<ClientSettings EnableRowHoverStyle="true">
  
<Selecting AllowRowSelect="True" />
  
<ClientEvents OnRowSelecting="RowSelected" />
  
</ClientSettings>

After clicking the next page on pager, the page goes post back and loses the instance of grid. only this line remains:

<input id="radGridABC_ClientState" name="radGridABC_ClientState" type="hidden" autocomplete="off">

any ideas why??

Ersin
Top achievements
Rank 1
 answered on 04 Jan 2011
1 answer
75 views
I have a RadComboBox I am using ItemsRequested to populate the combobox with data that is filtered by the contents of another asp:TextBox control. So it is something like this:

<asp:TextBox runat="server" id="txtFilter" />
 
<telerik:RadComboBox runat="server" ID="rcbPCN" AllowCustomText="true" EnableLoadOnDemand="true"
                                 OnItemsRequested="rcbPCN_ItemsRequested"
                                 AutoPostBack="True" CausesValidation="False"
                                onselectedindexchanged="rcbPCN_SelectedIndexChanged" Filter="StartsWith" />
 
.... code behind:
 
        protected void rcbPCN_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
                var query = PlanManager.QueryPlans().Where(q => q.bin == txtFilter.Text);
                rcbPCN.DataSource = query;
                rcbPCN.DataBind();
        }

The problem is that txtFilter.Text in the ItemsRequested event is only read the first time. After I delete the text from the RadComboBox, then change the text in txtFilter, then click the arrow on the combobox again, the results it shows me are from the original value of txtFilter.Text, not the newly changed value. How can I get around this? I need the combobox to always show a list of results that match the current value of txtFilter.Text.

thanks!
Brandon
Simon
Telerik team
 answered on 03 Jan 2011
2 answers
275 views
I have a page with an UpdatePanel containing a couple of dropdowns, a retrieve button, and a RadGrid. The idea is that the user would select a set of data using the dropdowns, and click the retrieve button.  This would then populate the grid, and the user would then be able to add/edit/delete the displayed data.

Simple enough, but there was a problem.  The user could click on the "Add New Record" button at the top of the grid, which would display the the insert record control, when the selection criteria in the dropdowns had not been set.  Clicking its "Inert" button would generate errors, because there were no selected values in the dropdowns.

My fast fix was to set "theGrid.Visible = False", and to make the grid visible only after the partial postback on the retrieve button.  With this change, the insert record worked, but the edit existing record did not.  When I clicked on the button in the GridEditCommandColumn, the little busy spinner spun, but the edit control was never displayed.  It looks as if the grid isn't being properly initialized, if it's not visible on initial page load.

In any case, changing it to "theGrid.Enabled = False" made everything work fine.
Jeff
Top achievements
Rank 1
 answered on 03 Jan 2011
2 answers
158 views
I have 4 RadDocks ("RadDock1", "RadDock2", etc.) inside of RadDockZone1.  In the OnClientDockPositionChanged() function in Javascript, I would like to iterate through each RadDock in RadDockZone1.  How can I do this using a foreach loop, or another method?
Richard M
Top achievements
Rank 1
 answered on 03 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
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
Bronze
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?