Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
245 views
Hey all,

I have an MVC app that lets the user use the RadDate and RadTime pickers to choose a date and time for an event (separate inputs).  I read the documentation on how to extract the value... but having some problems when the page is submitted and there are errors.  Namely I want to:  A. Put the value back into the field from ViewData, B. Have a red border show up if the date is invalid (e.g. in the past, or is missing, etc.).

When I try to do a simple <% if (ViewData["regform.Birthdate"]) {%>  etc. it says "Code blocks are not supported in this context".

Anyone able to help me figure out whats going on with this?

Thanks,
Robin
gyelle
Top achievements
Rank 1
 answered on 04 Mar 2009
6 answers
389 views
I've a RadGrid with EditFormType="WebUserControl" EditMode="PopUp" PopUpSettings-Modal="true".
UserControl initialization is done on the Page_Load event, under (_dataItem != null) condition, and instantiation under (_dataItem is IXPathNavigable) condition (DataSource is an XMLDataSource).

Further initialization of the userControl (some behavior params) is done on the RadGrid_ItemCreated event, when (e.Item is GridEditFormItem && e.Item.IsInEditMode && e.Item.DataItem != null).

The problem is that althougth PopUpSettings are Modal focus goes away of the popup (it doesn't happen on a Modal RadWindow, but only on RadGrid edition Popup)... It'd be a minor drawback (I've noted also that the Popup width is smaller than the declared width, so a 100% width draws a little content outside) but I haven't been able to set focus to the first control inside the UserControl.

May be one way to do that is through the PopUpShowing RadGrid client event, but the event is declared on the RadGrid page and I've not found a way to name a Control inside the UserControl of the Popup.

Moreover, there is an other problem with the modal popup: position isn't preserved between the UserControl postbacks.

As the UserControl does some "on change" computing I use the technique described on mantain focus between postbacks (adapted as mine works inside a UserControl), but of course I've unpplugged this hack when testing proves to avoid any lateral effect.



I've finally set focus on first control, setting its ClientID into the __LASTFOCUS hidden field described on the document mantain focus between postbacks, although focus still goes away to the disabled  (cause of Modal mode) controls of the page using the TAB key. But I still don't know how to preserve popup position between postbacks.

There is an other problem also: a mose over disabled controls of the UserControl PopUp cause a javascript error even when code has no javascript event programmed.
Servando
Top achievements
Rank 1
 answered on 04 Mar 2009
5 answers
352 views
Hi,
i have situation where i need to update only certan columns in database. I to this in normal mode like:
private void HideGridColumnsByType(RadGrid grid)
        {
            GridColumn column;
            switch (ReturnSelectedType())
            {
                case DbType.Int32:
                    column = grid.MasterTableView.Columns.FindByUniqueName("ModifierIntValue");
                    column.Visible = true;
                    break;
                case DbType.Single:
                    column = grid.MasterTableView.Columns.FindByUniqueName("ModifierDecimalValue");
                    column.Visible = true;
                    break;
                case DbType.DateTime:
                    column = grid.MasterTableView.Columns.FindByUniqueName("ModifierDateTimeValue");
                    column.Visible = true;
                    break;
                case DbType.String:
                    column = grid.MasterTableView.Columns.FindByUniqueName("ModifierStringValue");
                    column.Visible = true;
                    break;
                case DbType.Boolean:
                    column = grid.MasterTableView.Columns.FindByUniqueName("ModifierBooleanValue");
                    column.Visible = true;
                    break;
            }
        }
And this works fine. Still, when i am under event for edit
 if (e.CommandName == "Edit")
                {
                    var edititem = e.Item as GridEditableItem;
                    //edititem["ModifierIntValue"].Visible = false;
                    //edititem["ModifierDecimalValue"].Visible = false;
                    //edititem["ModifierDateTimeValue"].Visible = false;
                    //edititem["ModifierStringValue"].Visible = false;
                    //edititem["ModifierBooleanValue"].Visible = false;
                    edititem.EditManager.GetColumnEditor("ModifierIntValue").ContainerControl.Visible = false;
                    edititem.EditManager.GetColumnEditor("ModifierDecimalValue").ContainerControl.Visible = false;
                    edititem.EditManager.GetColumnEditor("ModifierDateTimeValue").ContainerControl.Visible = false;
                    edititem.EditManager.GetColumnEditor("ModifierStringValue").ContainerControl.Visible = false;
                    edititem.EditManager.GetColumnEditor("ModifierBooleanValue").ContainerControl.Visible = false;
                    switch (ReturnSelectedType())
                    {
                        case DbType.Int32:
                            edititem.EditManager.GetColumnEditor("ModifierIntValue").ContainerControl.Visible = true;
                            //column = grid.MasterTableView.Columns.FindByUniqueName("ModifierIntValue");
                            //column.Visible = true;
                            break;
                        case DbType.Single:
                            edititem.EditManager.GetColumnEditor("ModifierDecimalValue").ContainerControl.Visible = false;
                            //column = grid.MasterTableView.Columns.FindByUniqueName("ModifierDecimalValue");
                            //column.Visible = true;
                            break;
                        case DbType.DateTime:
                            edititem.EditManager.GetColumnEditor("ModifierDateTimeValue").ContainerControl.Visible = false;
                            //column = grid.MasterTableView.Columns.FindByUniqueName("ModifierDateTimeValue");
                            //column.Visible = true;
                            break;
                        case DbType.String:
                            edititem.EditManager.GetColumnEditor("ModifierStringValue").ContainerControl.Visible = false;
                            //column = grid.MasterTableView.Columns.FindByUniqueName("ModifierStringValue");
                            //column.Visible = true;
                            break;
                        case DbType.Boolean:
                            edititem.EditManager.GetColumnEditor("ModifierBooleanValue").ContainerControl.Visible = false;
                            //column = grid.MasterTableView.Columns.FindByUniqueName("ModifierBooleanValue");
                            //column.Visible = true;
                            break;
                    }
                }

this doesn't work? anyone has an idea how to hide fields when i press edit?

Thanks,
Vjeran






Vjeran
Top achievements
Rank 2
 answered on 04 Mar 2009
1 answer
80 views
Well everything in the topic. Is it possible ?
I have to make a page with a scheduler for each ressource, then I want to move tasks between all the schedulers.
Regards,
Atanas Korchev
Telerik team
 answered on 04 Mar 2009
10 answers
319 views
In the MOSS oob editor one can select from predefined tablestyles. You can also select if you would like to use predefined header, footer, firstcolumn and lastcolumn styles.
The oob editor also supported automatic style apply for even/odd rows and columns.

I just installed the RadEditor 7.3.3.0 and noticed the lack of this functionality in the RadEditor.
-Selecting a CSS style for the table from the dropdown-list in the table wizard does not apply the predefined styles for the table tr and td tags at all. It applyes css class for table tag, but this is defines no styles for the table.
-The only way to select some of the predefined styles is to apply them manually cell by cell, which is error prone and time/nerve consuming.

Is this really the way RadEditor works with predefined table styles?
Marc
Top achievements
Rank 1
 answered on 04 Mar 2009
1 answer
136 views
Hi,

first of all I want to notice, that the "SilverlightManager" looks strange.
There are 2 Checkboxes - one without text (makes windowless) -- and a second where the Text is in Line 2 (Background image)

The most problem makes the editor itself.
I insert a silverlight object and the code looks like this:
<object type="application/x-silverlight" height="150" width="150" data="data:application/x-silverlight,">  
<param name="source" value="/ClientBin/SilverlightApplication1.xap">  
<param name="background" value="">  
<param name="windowless" value="true">  
<param name="enablehtmlaccess" value="false"></object> 
After switching to HTML and back to desing - I go again to HTML - my code looks now like this:
<object type="application/x-silverlight" height="150" width="150" data="data:application/x-oleobject;base64,QfXq3+HzJEysrJnDBxUISgAIAACBDwAAgQ8AAAIAAAAAAAAAAAAAAAAATgAAAC8AQwBsAGkAZQBuAHQAQgBpAG4ALwBTAGkAbAB2AGUAcgBsAGkAZwBoAHQAQQBwAHAAbABpAGMAYQB0AGkAbwBuADEALgB4AGEAcAAAADwAAAD//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=">  
<param name="source" value="/ClientBin/SilverlightApplication1.xap">  
<param name="background" value="">  
<param name="windowless" value="true">  
<param name="enablehtmlaccess" value="false"></object> 
The datatag is "changed" from application/x-silverlight" to x-oleobject with some base64 coded id.
This only happens when I transit the viewmode to HTML an back.
Also when I mark the silverlight element (in desing) and press "del" it gets not removed.
I have to switch to HTML - remove the object block and than go back to design.

Also the "Properties Inspector" can't handle the silverlight (object) tag.

It would be great to be able to add parameters (without going to HTML) - but the greatest problem are the changes made, when switching to HTML.

Regards

Manfred
Lini
Telerik team
 answered on 04 Mar 2009
1 answer
127 views
//page load

 

protected void Page_Load(object sender, EventArgs e)

 

{

// check if StoreIt is not empty
if(setStoreIt.Equals("KeepItAlive")){
//Do something
}
}


public string storeIt{get; set}

private void setStoreIt()
{
    StoreIt = "KeepItAlive";
}

Unfortunately the setStoreIt Automatic Method gets reset everytime a postBack happenes.

I always used HiddenFields to get around this issue.

But today I am presented with an issue where i have to keep a <List> alive.

Any ideas?

Is this a problem with ajaxified pages?

Can I add the automatic method in the aJaxManajer? Ha Ha

Thanx!

Mark Fitzpatrick
Top achievements
Rank 1
 answered on 04 Mar 2009
1 answer
122 views
Hi

I am successfully header properties in the code behind using this code ...
If e.Column.UniqueName = "Format" Then  
            e.Column.HeaderText = "Size" 
            e.Column.HeaderStyle.Width = Unit.Pixel(60)  
            e.Column.ItemStyle.HorizontalAlign = HorizontalAlign.Right  
        End If 
EXCEPT for the horizontal align which is ignored in favour of the default left align .
I see there was a comment that this was fixed in Jan 2008 but it still does not seem to work
correctly?.

I am using 2008.3 download 11 december 2008.

Has there been a fix in a subsequent release? Is there some other way to do it?
Some column headers are still left aligned so a blanket setting does not work.

Thanks

Clive
Daniel
Telerik team
 answered on 04 Mar 2009
1 answer
96 views
Hi to all,
in my page there is the RadCalendar and a grid.
I need to show in advanced edit form a ticket chosen from the grid.
How can I do that?
I tried to write this:

 


Appointment
app = new Appointment();

 

app.ID = id;

app.Start = start;

app.End = end

 

RadScheduler1.ShowAdvancedEditForm(app,

false);

but then, we it enters in the advanced edit form, and I for instance a change a date, the Save button does not work (no event, it remains in the form, without entering the 

 

RadScheduler1_AppointmentUpdate).

Many thanks in advance for Your help.
Sergio

Peter
Telerik team
 answered on 04 Mar 2009
1 answer
106 views
Hi to all,
how is it possible to disable the date-time validator control in the RadScheduler's advanced edit form?
It is the one whereby the following message appears: "Start time must be before end time".
Many thanks in advance.
Best Regards,
Sergio
Peter
Telerik team
 answered on 04 Mar 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?