Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
434 views
Hi,
i have a RadCalendar control on my page.
I am trying to set a RadCalendar selected date as March 15, 2011
but always shows February month
what i am doing wrong..?

here is my code
<telerik:RadCalendar runat="server" ID="RadCalendar1" ShowOtherMonthsDays="false" 
      EnableMonthYearFastNavigation="true" AutoPostBack="true">
</telerik:RadCalendar>

protected void Page_Load(object sender, EventArgs e)
  {          
     RadCalendar1.SelectedDate = DateTime.Parse("2011-03-15 11:02:00.000");
     //RadCalendar1.SelectedDate = DateTime.Parse("03/15/2011");
  }


can any one help me?
Venkata
Top achievements
Rank 1
 answered on 02 Feb 2011
2 answers
146 views
Hi,

I am trying to access the text box in a radgrid and pass the values of the selected row in the grid with the new value in the textbox to a radwindow which is opened when a button in the same row is clicked. 

I am using the following code

aspx:
function ShowDispatchNote(rowIndex, MediaID, ReferenceText) {
                var grid = $find("<%= rgBookoutMedia.ClientID %>");
                var firstDataItem = $find("<%=rgBookoutMedia.ClientID %>").get_masterTableView().get_dataItems()[rowIndex];
                var MediaID = firstDataItem.getDataKeyValue("MediaID");
                var masterTable = grid.get_masterTableView();
                for (var i = 0; i < masterTable.get_dataItems().length; i++) {
                    // to access the textbox in each row 
                    var txtbx = masterTable.get_dataItems()[i].findElement("rtbReference");
                    // set alert 
                }
                window.radopen("DispatchNote.aspx?MediaID=" + MediaID + "&ReferenceText=" + txtbx.Text, "RadWindow1");
                return false;
            }


cs:
if (e.Item is GridDataItem)
            {
                GridDataItem dataItem = rgBookoutMedia.NamingContainer as GridDataItem;
                Button btnConfirm = (Button)e.Item.FindControl("btnConfirm");
                RadTextBox rtbReference = (RadTextBox)e.Item.FindControl("rtbReference");
                btnConfirm.Attributes["onclick"] = String.Format("return ShowDispatchNote('{0}','{1}');", e.Item.ItemIndex, e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["MediaID"], rtbReference.Text);
            }

I am able to get the value of MediaID as I have specified it as DataKeyNames in the MasterTableView. The other query string ReferenceText shows up as undefined always. How do I get the value of the textbox with new values in the client side before opening the rad window.

The example in http://www.telerik.com/community/code-library/aspnet-ajax/grid/accessing-server-controls-in-a-grid-template-on-the-client.aspx doesn't satisfy my criteria. Can anyone show me a code sample on how to pass the new textbox value to the radwindow.

Thanks
Prithvi
Prithvi
Top achievements
Rank 1
 answered on 02 Feb 2011
1 answer
127 views
Hi Telerik,

So, I am creating a web portal and it is mainly composed of dynamically created controls. There is a RadSplitter which holds panes which are resizable through the use of the RadSplitBar.

The issue is this: If I have LiveResize turned on -- the user grabs aholds of the RadSplitBar and drags it around. This cause's the client-side OnClientResized event to fire...a lot, I believe. Yet, it looks all normal. No lag or anything after the resize finishes and nothing seems to be hanging. Then, I dynamically create a new control on the page and throw up a loading icon as it generates. The amount of movement of the RadSplitBar seems to be correlated to the amount of time it takes the control to appear on the screen. If LiveResize is off, I see no real issues. If I move the RadSplitBar only a little then the control is created in ~5 seconds. If I grab the RadSplitBar and drag around wildly -- the control never seems to create and the program hangs with a loading panel.

I'm looking for a solution to this as our web dashboard is fairly interactive and it would be nice to see the changes live.

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server" >
    <script type="text/javascript">
        function OnClientResized(pane, args) {
            var context = new Object();
            var paneIDandHeightandWidth = pane.get_id() + ',' + pane.get_height() + ',' + pane.get_width();
            //Context is just thrown away.
            CallSetDimensions(paneIDandHeightandWidth, context);
        }
 
        function CallbackOnSucceeded(result, context) {
        //Logging
        }
 
        function CallbackOnFailed(result, context) {
        //Logging
        }
    </script>
</telerik:RadCodeBlock>

The dynamically created RadPane's set their OnClientResized event to this OnClientResized function.

Server-side code:

protected void Page_Load(object sender, EventArgs e)
{
    RegisterCallBackReference();
}
 
private void RegisterCallBackReference()
{
    String callBack = Page.ClientScript.GetCallbackEventReference(this, "arg", "CallbackOnSucceeded", "context", "CallbackOnFailed", true);
    String clientFunction = "function CallSetDimensions(arg, context){ " + callBack + "; }";
    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Call To Server", clientFunction, true);
}
 
#region ICallbackEventHandler Members
String returnValue;
string ICallbackEventHandler.GetCallbackResult()
{
    return returnValue;
}
 
void ICallbackEventHandler.RaiseCallbackEvent(string eventArgument)
{
    bool result = SetDimensions(eventArgument);
 
    if (result)
    {
        returnValue = "Success.";
    }
    else
    {
        returnValue = "Failure.";
    }
}
#endregion
 
private bool SetDimensions(string args)
{
    bool saveSuccessful = false;
 
    string[] paneIDandHeightandWidth = args.Split(',');
    string paneID = paneIDandHeightandWidth[0];
 
    int paneHeight = 0;
    int.TryParse(paneIDandHeightandWidth[1], out paneHeight);
 
    int paneWidth = 0;
    int.TryParse(paneIDandHeightandWidth[2], out paneWidth);
 
    RadPane pane = Utilities.FindControlRecursive(Page, paneID) as RadPane;
 
    if (!object.Equals(pane, null))
    {
        saveSuccessful = true;
        RadPaneSetting paneSetting = RadPaneSetting.GetSettings(pane);
        pane.Height = new Unit(paneHeight, UnitType.Pixel);
        pane.Width = new Unit(paneWidth, UnitType.Pixel);
        controlSave.SavePane(pane);
    }
 
    return saveSuccessful;
}


Sorry this code isn't exactly..standard. I need to be able to call SavePane after updating a pane's properties so that Session is aware of the updates. Then, when the page reinitializes I get pane's that maintain their resized-ness.

Does this all make sense? Is there anything I can do here? Something like... detect that more re-sizes have occurred (e.g. the user hasn't let go of the RadSplitBar yet) and only call my event after all the resizing is done? I only need to save the pane state at the end of all the movement. 
Dobromir
Telerik team
 answered on 02 Feb 2011
2 answers
139 views
Hi to all.

I'm trying to use the RadProgressArea, but I get an error alert message (attached screen).

I'm going to this help topic http://www.telerik.com/help/aspnet/upload/raduploadprogresshandler.html and I try to follow the instructions, but I'm still having errors, then in the web config (attached screen again). I have the 2010 Q1 version installed of ASP.NET AJAX controls and I only have the Telerik.Web.UI.dll and the Telerik.Web.Design.dll files.

What I have to do?

Thanks in advance and happy new year.

Jesús
Jesús
Top achievements
Rank 1
 answered on 02 Feb 2011
1 answer
123 views
Hi,
I wanto to show only two days in schedular it's possible ? how?

 
Veronica
Telerik team
 answered on 02 Feb 2011
1 answer
63 views
Gurus,
Is it possible to obtain the column name and cell content in Rowcontext menu?
Your help would be really appreciated...
Vasil
Telerik team
 answered on 02 Feb 2011
3 answers
112 views
I followed the example Selecting Last Inserted Item which seems to work pretty well, but only if I have paging enabled.
 
If I disable paging and UseStaticHeaders="false" it works.
If I disable paging and UseStaticHeaders="true" it does not work.

Should it be scrolling the item into view with UseStaticHeaders="true"?

What is the best workaround for this, to get the selected item into view when UseStaticHeaders="true"

Thanks in advance

Vasil
Telerik team
 answered on 02 Feb 2011
5 answers
104 views
hello,

I am using your control radfilter, and noticed the following problems:

- When I'm working with radfilter, and I select a column of type "bit" and say that it is false, the radgrid is filled with the correct filter, so try to give the true value, it returns an exception and not grid shall bind. By doing so I noticed that a breakpoint that say that the value false he always puts the matter after post put the true value. This bug only happens with columns of type "bit".

- I came across yet another problem when using the provider "RadFilterSqlQueryProvider"to get the sql expression, I noticed that in the cases of columns of type "bit" the provider puts "[ColumnName] = False" instead of putting "[ColumnName ] = 0or "[ColumnName] = 'False'".

Regards.
Rui
Top achievements
Rank 1
 answered on 02 Feb 2011
1 answer
55 views
I create a rad window with a url loaded in it.  

In this window, there is a rad grid with a good width, it looks like 100% the width of the rad window.

When I press the [+] button within the grid to add a record to this grid, it shows the MasterTableViewEditForm template of the grid and now there is a horizontal scroll bar on the rad window.  Inside the template, I have a div and a table like this:

                        <FormTemplate>
                            <div ID="RadGridEditForm" style="padding:5px 5px 5px 5px;">
                                <table cellpadding="2" width="100%">
                                    <tr>
                                        <td width="80%">
                                         .....

Notice how the table is set to 100%.  This causes the grid and hence the radwindow to be much wider than expected and I get a horizontal scroll bar on the radwindow.

If I guess at the width of the table, I can find a value that does not create a scroll bar, but should I have to do this?  How can I just set the width to 100% and have it stretch to 100% of the rad window and not something larger?  If I remove the width specifier from the table, the table is narrower than the window (only about 2/3rds the way across).  I don't see anything else pushing the window that wide, so I don't know why making this table 100% is making the rad window internally wider than it is displaying.

Michael Grant
Georgi Tunev
Telerik team
 answered on 02 Feb 2011
5 answers
279 views
I've done quite a bit of searching and cannot find an example of self-referencing hierarchical grid that is paginated at the database level.

For example:
  • Pull 50 categories from the database (set virtual item count to enable viewing of all pages).
  • Show an expand button if that category has a parent category.
  • If expand button is clicked, expand those 50 categories, repeating the same functionality in the above steps to allow categories to be expanded to the Nth level.

The only way I can accomplish this right now is to get a list of ALL categories in the database. This is not very efficient.

Is there any example displaying this?
PSCU Developers
Top achievements
Rank 1
 answered on 02 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?