Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
113 views
I'm creating a page not completely unlike this demo. Like the demo I have a RadCalendar displayed that the user uses for quick navigation in the RadScheduler.

I've got things set up so when they change the view in the Calendar, the Scheduler updates. I want to do the reverse, so that when the user navigates directly in the Scheduler, the Calendar view updates.

I've got this in my code-behind ...
protected void RadScheduler1_NavigationComplete(object sender, SchedulerNavigationCompleteEventArgs e)
{
    RadCalendar1.SelectedDate = RadScheduler1.SelectedDate;
}

and the AjaxSettings on the page include this ...
<telerik:AjaxSetting AjaxControlID="RadScheduler1">
    <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="RadScheduler1"
                                    LoadingPanelID="RadAjaxLoadingPanel1"/>
        <telerik:AjaxUpdatedControl ControlID="RadCalendar1"
                                    LoadingPanelID="RadAjaxLoadingPanel1"/>
    </UpdatedControls>
</telerik:AjaxSetting>

Now I know that you have made no provision for this update in your demo, but when I run my code, I can see the selected date in the Calendar being updated (I've got EnableMultiSelect="False" BTW) but the Calendar display simply refuses to change. I can also see that the Ajax update is working 'cos the LoadingPanel displays.

I suppose I'm looking for an equivalent to Rebind() or somesuch to get the Calendar to redraw. 

What am I missing?

-- 
Stuart


Stuart Hemming
Top achievements
Rank 2
 answered on 11 Nov 2010
4 answers
1.3K+ views
Hi,

For displaying datetime values in a RadGrid column I am using a GridBoundColumn with DataType="System.DateTime" and DataFormatString="{0:M/d/yyyy}".  This works fine except in cases where the bound value is null (DateTime.MinVal) - the date value is displayed as "1/1/0001". 

I could define the column as a string and emit a blank string when the date field is set to DateTime.MinVal, but then I loose the capability of sorting on the date column (unless the date format is "yyyy/MM/dd".

Is there a way to leave the data type of the column as "DateTime" and also display an empty cell if the value of the date is DateTime.MinVal?
Rich
Top achievements
Rank 1
 answered on 11 Nov 2010
2 answers
84 views
i am using the megadropdown menu, it works fine in IE 6.0,7.0,8.0 but not in firefox, please help.

just below the menu, there is a flash object, in firefox when we mouse over the megadropdown it automatically disappears as though there is a timeout., the strange thing is if the megadropdown extends in height beyond the height of the flash object(height:233px), if you mouse over quickly on the lowest part of the megadrop down, it stays intact without disappearing, but when we mouse over the upper part of the megadropdown (where you can see the flash object in the background), the menu disappears.

the z:index of the flash object is '0' and the z-index of the menu is 7000, again it works fine in IE, but not in firefox.
http://208.109.170.81/Create/Adults/Classes/Drawing---Painting.aspx

thanks in advance
Tanuj
Top achievements
Rank 1
 answered on 11 Nov 2010
2 answers
226 views
Hello,

Does anyone know which event on the RadGrid I can dynamically add RequiredFieldValidators and have them fire client side?  Physically placing the Validators inside of the <EditTemplate> works like a champ.

Right now we are using the ItemDataBound, and also have tried the ItemCreated event.  Those seem to be the only places to inject validators when the update button is clicked...

The .AddValidator method is an extension method tied to controls to determine which validation message to assign to the validator and then dynamically add the validator.  This code works on the rest of the site, just not for InPlace editing of grids so far.

Code to add the validator to the page.  Maybe I'm adding the validator to the wrong place, but I'd think that control.Parent would represent the "cell" the control lives in.
// control is the Control validation is being added to
control.Parent.Controls.Add(requiredFieldValidator);

Sample ItemDataBound method
protected void rgPmpDetails_ItemDataBound(object sender, GridItemEventArgs e)
{
    const string valGroup = "vgEditPmpDetails";
 
    GridHelper.AddEditValidator(e, "rntbCreditPercentGrid", valGroup, "Premium Credit");
    GridHelper.SetFocusToFirstControlWhenInEditMode(e, "rntbCreditPercentGrid");
}

And the GridHelper function does this:
public static void AddEditValidator(GridItemEventArgs e, string controlId, string validationGroup, string fieldName, bool isMultiSelect = false)
{
    if ((e.Item is GridEditableItem) && e.Item.IsInEditMode)
    {
        Control control = e.Item.FindControl(controlId);
        if (control != null)
        {
 
            if (control is TextBox)
            {
                (control as TextBox).ValidationGroup = validationGroup;
                (control as TextBox).AddValidator(fieldName);
            }
            else if (control is DropDownList)
            {
                (control as DropDownList).ValidationGroup = validationGroup;
                (control as DropDownList).AddValidator(fieldName);
            }
            else if (control is RadNumericTextBox)
            {
                (control as RadNumericTextBox).ValidationGroup = validationGroup;
                (control as RadNumericTextBox).AddValidator(fieldName);
            }
            else if (control is RadComboBox)
            {
                (control as RadComboBox).ValidationGroup = validationGroup;
                (control as RadComboBox).AddValidator(fieldName, isMultiSelect);
            }
            else if (control is RadDatePicker)
            {
                (control as RadDatePicker).DateInput.ValidationGroup = validationGroup;
                (control as RadDatePicker).AddValidator(fieldName);
            }
            else
            {
                throw new NotImplementedException("Controls of type [" + control.GetType() + "] have not been implemented in GridHelper.AddEditValidator.");
            }
        }
 
        ImageButton imageButton = e.Item.FindControl("UpdateButton") as ImageButton;
        if (imageButton != null)
        {
            imageButton.ValidationGroup = validationGroup;
        }
    }
}
Thad
Top achievements
Rank 2
 answered on 11 Nov 2010
1 answer
55 views
For this code:

http://demos.telerik.com/aspnet-ajax/filter/examples/integration/defaultcs.aspx?product=filter

Is it possible to have the RadFilter control set to a default filter (e.g. "ShipVia" EqualTo "3"), when the page is first displayed?

Thanks,

Richard.
Richard
Top achievements
Rank 1
 answered on 11 Nov 2010
2 answers
178 views
I've got the grid edit hyperlink working but I would rather use the default edit icon. Any ideas how to do this? Here is my code:

                <telerik:GridTemplateColumn UniqueName="TemplateEditColumn">
                    <FilterTemplate
                    </FilterTemplate>
                    <ItemTemplate>
                        <asp:HyperLink ID="EditLink" runat="server" Text="Edit"></asp:HyperLink>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>

protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem item = (GridDataItem)e.Item;
        HyperLink editLink = (HyperLink)e.Item.FindControl("EditLink");
        editLink.Attributes["href"] = "#";
        editLink.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", item.GetDataKeyValue("CatalogueItemId"), item.ItemIndex);
    }
}

The above works perfectly but I would really like to use the default edit icon instead of a hyperlink. Please help. Thanks

Troy
troyboy
Top achievements
Rank 1
 answered on 11 Nov 2010
3 answers
78 views
Hi Guys,

simple question i though but google did not give me the answer :)

Is it possible to use the Telerik RadControls with connected webparts?
If it is possible it would be nice to show me some sample code.

best regards

Jan
Tsvetoslav
Telerik team
 answered on 11 Nov 2010
1 answer
141 views
Hi,

I have a project that was originally created in VS 2003 and I've migrated it to VS 2008.

When I migrated the application, it created an entry in my Web.config file =  xhtmlConformance mode="Legacy"

I got to a point where I wasn't able to get an Update Progress control to display until I changed this to mode="Transitional".

However, once I did that I started having trouble with a page that has a RadTabStrip. When a tab is clicked, the page navigates properly but the tabstrip itself disappears. If I change the mode back to Legacy, the tab strip behaves properly but I'm unable to make the Update Progress control to work.

Any suggestions?

Thanks.
Dimo
Telerik team
 answered on 11 Nov 2010
1 answer
73 views
LINK

OnMouseDown on the button the width jumps in by 2-4 pixels

(Is there no depressed state on the buttons in that demo?)
Bozhidar
Telerik team
 answered on 11 Nov 2010
1 answer
293 views
I would like to use one ToolTip for multiple buttons.  The ToolTip has custom content which includes text, buttons, checkboxes.  My plan is to create a Javascript function to bring up the ToolTip when the button is clicked on. 

First, I would add the Javascript function to the client click event of my buttons:
Button1.Attributes.Add("OnClick","myFunction()");
Button2.Attributes.Add("OnClick","myFunction()");

Then I need to create a Javascript function (called myFunction) to bring up the tooltip:
function myFunction()
{
     // code goes here
}

How do I attach and bring up a ToolTip in Javascript?
Svetlina Anati
Telerik team
 answered on 11 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?