Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
165 views
It is stated in the roadmap that the Q2 version will be out in the early Juli.
Does this mean that we can look for an release next friday?
Ivo
Telerik team
 answered on 24 Jun 2009
1 answer
87 views
Any examples or recommendations for the best way to accomplish this.  I only know once the data is selected exactly how many grids will need to be created and I need to be able to page if necessary...
Sebastian
Telerik team
 answered on 24 Jun 2009
3 answers
184 views
Hello,

How to resize only one column only ?
When I chenge my first column clientside all the others get changed according some strange proportional rule (not totally respected from what I see).

Here is my grid:
<div style="width: 100%;">  
    <Telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True" 
        AllowSorting="True" ShowStatusBar="true" GridLines="None" ShowGroupPanel="True" > 
        <PagerStyle Mode="NextPrevAndNumeric" /> 
        <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" ReorderColumnsOnClient="True">  
            <Resizing AllowColumnResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True" /> 
            <Scrolling AllowScroll="True" ScrollHeight='400px' UseStaticHeaders="True" SaveScrollPosition="True" /> 
            <Selecting AllowRowSelect="True" /> 
        </ClientSettings> 
        <MasterTableView Width="100%" TableLayout='Fixed' AllowMultiColumnSorting="true">  
            <ItemStyle Wrap='true'  /> 
            <HeaderStyle Width='100px' /> 
            <AlternatingItemStyle Wrap='true' /> 
        </MasterTableView> 
        <SortingSettings SortedBackColor="Azure" /> 
    </Telerik:RadGrid> 
</div> 
 


Thanks again for help.

CS
Georgi Krustev
Telerik team
 answered on 24 Jun 2009
7 answers
592 views
I have a grid in which I have 3 columns where I set the Aggregate to either sum or count.  The footers appear properly when the grid is loaded initially (populated via the _NeedDataSource function), but when I rebind client side, the aggregate values are not updated.  Is there an easy way to do this?

Regards,
Cynthia
Georgi Krustev
Telerik team
 answered on 24 Jun 2009
1 answer
305 views
hi I am bindig custom controls(tradextbox,radadateinput vs.)on runtime on a grid.And After post i wantto got values from the custom columns..
the code for creating control snippet like this

 


 

    private void CreateCustomControl(TableCell templateControl, Property property)  
        {  
            switch (property.UiType)  
            {  
                case "RadTextBox":  
                    #region  
                    RadTextBox radTextBox1 = new RadTextBox();  
                    radTextBox1.ID = string.Format("RadTextBox_{0}", property.Id);  
                    if(!IsPostBack)radTextBox1.Text = property.DefaultValue;  
                    if (property.MaxLength != null)  
                    {  
                        radTextBox1.MaxLength = (int)property.MaxLength;  
                    }  
                    templateControl.Controls.Add(radTextBox1);  
                    #endregion  
                    break;  
                case "MultilineRadTextBox":  
                    #region  
                    RadTextBox radTextBox2 = new RadTextBox();  
                    radTextBox2.ID = string.Format("MultilineRadTextBox_{0}", property.Id);  
                    radTextBox2.TextMode = InputMode.MultiLine;  
                    if (!IsPostBack) radTextBox2.Text = property.DefaultValue;  
                    if (property.MaxLength != null)  
                    {  
                        radTextBox2.MaxLength = (int)property.MaxLength;  
                    }  
                    templateControl.Controls.Add(radTextBox2);  
                    #endregion  
                    break;  
                case "NumericTextBox":  
                    #region  
                    RadNumericTextBox radNumericTextBox = new RadNumericTextBox();  
                    radNumericTextBox.ID = string.Format("NumericTextBox_{0}", property.Id);  
                    if (!IsPostBack) radNumericTextBox.Value = !string.IsNullOrEmpty(property.DefaultValue) ? double.Parse(property.DefaultValue) : (double)0;  
                    radNumericTextBox.MaxValue = (double)property.MaxValue;  
                    radNumericTextBox.MinValue = (double)property.MinValue;  
                    templateControl.Controls.Add(radNumericTextBox);  
                    #endregion  
                    break;  
                case "RadDateInput":  
                    #region  
                    RadDateInput radDatePicker = new RadDateInput();  
                    radDatePicker.ID = string.Format("RadDateInput_{0}", property.Id);  
                    radDatePicker.ReadOnly = true;  
                      
                    if (!string.IsNullOrEmpty(property.DefaultValue))  
                    {  
                        if (!IsPostBack) radDatePicker.SelectedDate = Convert.ToDateTime(property.DefaultValue);  
                    }  
                    templateControl.Controls.Add(radDatePicker);  
                    #endregion  
                    break;  
                case "RadComboBox":  
                    #region  
                    RadComboBox radComboBox = new RadComboBox();  
                    radComboBox.ID = string.Format("RadComboBox_{0}", property.Id);  
                    string[] options = property.Options.Split('#');  
                    string[] optionItemKeyValPair;  
                    foreach (string optionItem in options)  
                    {  
                        optionItemoptionItemKeyValPair = optionItem.Split('$');  
                        radComboBox.Items.Add(new RadComboBoxItem(optionItemKeyValPair[0], optionItemKeyValPair[1]));  
                    }  
                    radComboBox.Items.Insert(0, new RadComboBoxItem(GetGlobalResourceObject("GeneralResource", "PleaseSelect").ToString(), "-1"));  
                    if (!IsPostBack) radComboBox.FindItemByValue(property.DefaultValue).Selected = true;  
                    templateControl.Controls.Add(radComboBox);  
                    #endregion  
                    break;  
                case "CheckBox":  
                    #region  
                    CheckBox checkBox = new CheckBox();  
                    checkBox.ID = string.Format("CheckBox_{0}", property.Id);  
                    if (!IsPostBack) checkBox.Checked = property.DefaultValue == "0" ? false : true;  
                    templateControl.Controls.Add(checkBox);  
                    #endregion  
                    break;  
            }  
        }  
     

and i call the method  on grid's itemcreated event

        protected void SelectGrid_ItemCreated(object sender, GridItemEventArgs e)  
        {  
            if (e.Item is GridDataItem)  
            {  
                GridDataItem item = e.Item as GridDataItem;  
 
                Entities.Domain.Property property = item.DataItem as Entities.Domain.Property;  
 
                if (property != null && property.PropertyTypeCodelookup != null && !string.IsNullOrEmpty(property.PropertyTypeCodelookup.UiType))  
                {  
                    CreateCustomControl(item["PropertyValueColumn"], property);  
                }  
            }  
        } 
and
if i bind grid every page_load event of page,
when i want to take values that entered into this custom controls ,it does resets values.
and if i only bind grid once at pagepostback
when i want to take values over the controls it return null referance...
public List<Property> SelectedProperties  
        {  
            get  
            {  
                List<Property> _selectedProperties=new List<Property>();  
                Property tmpProperty;  
                if (_currentPropertyCollection != null && _currentPropertyCollection.Count > 0)  
                {  
                    foreach (GridDataItem item in PropertySelectGrid.Items)  
                    {  
                        if (((CheckBox)item["Selection"].Controls[1]).Checked)  
                        {  
                            tmpProperty = _currentPropertyCollection.Find(p => p.Id == (Convert.ToInt64(item["Id"].Text)));  
                      
 
                            Control c = item["PropertyValueColumn"].Controls[0];  
                            string text = string.Empty;  
                            if (c is RadTextBox || c is RadNumericTextBox)  
                            {  
                                if (c is RadTextBox)  
                                {  
                                    text = ((RadTextBox)item["PropertyValueColumn"].Controls[0]).Text;  
                                }  
                                else if (c is RadNumericTextBox)  
                                {  
                                    text = ((RadNumericTextBox)item["PropertyValueColumn"].Controls[0]).Text;  
                                }  
                            }  
                            else if (c is RadDateInput)  
                            {  
                                if (((RadDateInput)item["PropertyValueColumn"].Controls[0]).SelectedDate.HasValue)  
                                {  
                                    text = ((RadDateInput)item["PropertyValueColumn"].Controls[0]).SelectedDate.Value.ToString();  
                                }  
                            }  
                            else if (c is RadComboBox)  
                            {  
                                if (((RadComboBox)item["PropertyValueColumn"].Controls[0]).SelectedItem != null)  
                                {  
                                    if (((RadComboBox)item["PropertyValueColumn"].Controls[0]).SelectedItem.Value != "-1")  
                                    {  
                                        text = ((RadComboBox)item["PropertyValueColumn"].Controls[0]).SelectedItem.Value;  
                                    }  
                                }  
                            }  
                            else if (c is CheckBox)  
                            {  
                                if (((CheckBox)item["PropertyValueColumn"].Controls[0]).Checked)  
                                {  
                                    text = "1";  
                                }  
                            }  
 
                            tmpProperty.DefaultValue = text;  
                            _selectedProperties.Add(tmpProperty);  
                        }  
                    }  
                }  
              //string key = "UnitPropertySelectedList_" + WebSessionManager.DataFilter.CurrentId;  
                //if (!WebSessionManager.DataFilter.ObjectList.ContainsKey(key) || WebSessionManager.DataFilter.ObjectList[key] == null)  
                //{  
                //    List<Property> propertyList = new List<Property>();  
                //    WebSessionManager.DataFilter.Add(key, propertyList);  
                //}  
                //return (List<Property>)WebSessionManager.DataFilter.ObjectList[key];  
                return _selectedProperties;  
             } 
what's wrong with this code?
and how can i  bind controls on grid dynamically  and got values  entered to  them ?
Nikolay Rusev
Telerik team
 answered on 24 Jun 2009
5 answers
240 views
Hi,

I am having a very strange problem and I'm not sure what is causing it.

I have built a WSS 3.0 web part that implements a Rad Scheduler (2009.1.527.35). I have implemented custom Object Data Sources exactly as described here: http://www.telerik.com/help/aspnet-ajax/schedule_databindingusingthedatasourceproperty.html

When I deploy the web part, the browser displays a 403 error. To get around this error I can do the following:

1. Open web.config
2. Change something - it can be anything, even just deleting a random character
3. Save the file
4. Site will error out - if I've deleted something important in the web.config
5. Undo changes to web.config - resave
6. Site will come back up and the web part will display

At this point everything will work fine with the scheduler control. All methods in the object data sources will work properly.

If at any time there is an IISRESET run on the server or if I recycle the app pool for this site, the page will go back to the 403 error.

I have narrowed it down to when the object data source is being bound to the scheduler control in my CreateChildControls() method that is causing the issue. I tried moving that code out of the CreateChildControls() and moving it to the RenderWebPart(), but I get a different error, "DataKeyField, DataSubjectField, DataStartField and DataEndField are required for databinding". Which makes sense.

I have also tried to add the object data sources in both OnInit() and CreateChildControls() and the 403 error appears the same for both variations.

From what I can gather, it seems the scheduler control is trying to databind during the CreateChildControls() method and somehow it doesn't have permission to access the object data sources. To ensure it wasn't any custom code in my object data sources, I created a test Select method with no code and bound to that. I had the same problem. Now I also know the 403 is getting thrown before any of my object data source code is actually hit.

I'm not sure if it matters that I am adding the object data sources dynamically to the page or not? Or whether it matters that I am adding those and the scheduler to the page at the same time?

I'm also not sure if I need to add something to my object data source classes to make them accessable from the web part. I tried the AllowPartiallyTrustedCallersAttribute without success.

Here's the setup of my solution:
1. All files are under 1 project - so when I build, I get 1 assembly
2. All classes are using the same namespace (custom)
3. 1 class file that handles the web part code - inherits from Microsoft.SharePoint.WebPartPages.WebPart
4. 1 class file that handles all my custom toolpane options - inherits from Microsoft.SharePoint.WebPartPages.ToolPart
5. All other class files have no inheritance

Another thought I have is that because my custom data source classes have no inheritence to anything in SharePoint, when they are first loaded SharePoint doesn't know they exist under the context? But I did put the proper SafeControl entry in the web.config for the entire namespace (which includes my custom classes). So that one seems unlikely.

I have also followed all the online documentation on adding the telerik customizations to the web.config. I have set my SP trust level to "Full" and I even tried creating a custom CAS file, specifying my DLL. Neither of those solve my problem. My SP site is running under Basic authentication. (I tried integrated, without success)

Has anyone ever tried building a web part using RadScheduler and Object Data Sources? Any ideas or possible solutions to try are appreciated.

Thanks.
Dimitar Milushev
Telerik team
 answered on 24 Jun 2009
12 answers
1.1K+ views
We just upgraded to the ASPNET AJAX Q1 2009 Controls and now our RadComboBoxes are wrapping text not on spaces (like they did before the upgrade), but are wrapping on whatever letter happens to be at the end of the row (as determined by the width set on the RadComboBox). 

For example, the first line is: "Adjust Current Year Excess/Revoked Contribut"
2nd line (wrapped text from above line is) "ions"

Is there a setting we can use that will wrap text on a space instead of in the middle of a word?
Kamachi Ravichandran
Top achievements
Rank 1
 answered on 24 Jun 2009
1 answer
321 views
hi,

I need to be able to extract the SQL FilterExpression from a radgrid on the client-side.  On clicking a button, I have a javascript function which should get the filter expression as an SQL string and then send it to a new window through a URL.

The new window then takes the FilterExpression from the URL and applies it to a new radgrid on the server side. This is for a "print friendly" version of the grid.

My javascription function is called from a client-side button click handler and looks like:

 

function PrintRadGrid() {

 


var
ClientsGrid = $find("<%=ClientsGrid.ClientID %>");

 

 

 

 

 

 

var f = ClientsGrid.get_masterTableView().get_filterExpressions().toString();

 

 

 

var previewWnd = window.open('print/Clients.aspx?Filter=' + escape(f), '', '', false);

 


previewWnd.print();

 

 

 

 

 

}

Problem is that the filter variable is always blank and I cannot get the SQL expression I need.

Any ideas?

Thanks!

Veli
Telerik team
 answered on 24 Jun 2009
2 answers
86 views
Hi

I am using radtabstrib and adding tabs and page views dynamically, page views itself has user controls inside, so I am recreating all this on each postback, however everything works perfect until I put radgrid inside the user control (it works ok with regular GridView) the error is the following.
The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.

The exception throws as soon as I try to add user control with rad grid inside, into the page view
private void RecreateTabsPageViews() 
    { 
        if (Session["TabPageViewsContents"] == null) return; 
        List<Control> PageViewsList = (List<Control>)Session["TabPageViewsContents"]; 
        int index = 0; 
        foreach (Control c in PageViewsList) 
        { 
            CenterTabStribMultiPage.PageViews[index].Controls.Add(c); 
            index++; 
        } 
    } 

Please advice.
Thanks
Sebastian
Telerik team
 answered on 24 Jun 2009
1 answer
157 views
Hi,

I followed the listview demo:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/listview/defaultcs.aspx

to produce a listview display of thumbnail images via asp.net Image control:

                        <telerik:RadGrid ID="RadGrid1" DataSourceID="EntityDataSource1" AllowFilteringByColumn="false" 
                            runat="server" GridLines="None" AllowPaging="true" AllowSorting="false" OnPreRender="RadGrid1_PreRender" 
                            PageSize="6">  
                            <PagerStyle Mode="NextPrevAndNumeric" />  
                            <MasterTableView TableLayout="Auto" ShowHeader="false">  
                                <ItemTemplate>  
                                    <%# (((GridItem)Container).ItemIndex != 0)? "</td></tr></table>" : "" %>  
                                    <asp:Panel ID="ItemContainer" CssClass='<%# (((GridItem)Container).ItemType == GridItemType.Item)? "item" : "alternatingItem" %>' runat="server">  
                                        <asp:Image ID="Image1" runat="server" ImageUrl=<%# Eval("Path")%> Height="40" Width="40" ImageAlign="Middle" />  
                                    </asp:Panel>  
                                </ItemTemplate>  
                            </MasterTableView>  
                            <GroupingSettings CaseSensitive="false" />  
                            <ClientSettings AllowColumnsReorder="true" AllowDragToGroup="true" ReorderColumnsOnClient="true" AllowRowsDragDrop="true">  
                                <Selecting AllowRowSelect="true" />  
                                <Scrolling AllowScroll="true" UseStaticHeaders="true" />  
                            </ClientSettings>  
                        </telerik:RadGrid> 

It worked as expected, however, when I place lines number 14-17 to produce the drag and drop effect, the drag and drop functionality works per row, which as per demo, all data items, (in my case asp.net image controls) are just one row, thus, when dragging, I'm dragging every thumbnail displayed in one go - which is not the desired effect.

Hope you can explain how can I achieve drag&drop per data item (w/c in this case is the Image Control binded by Eval("Path") ), in a ListView Style (w/c displays items horizontally).

Many Thanks,
Henry Wu
Veli
Telerik team
 answered on 24 Jun 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?